def __str__(self): s = super().__str__() # we have to reinstate the second / of http:// as PurePosixPath removes it return re.sub('(https?:)/([^/])', r'\1//\2', s)