@@ -60,7 +60,7 @@ def safe_urlparse(href: str) -> URLParseResult:
6060 and not href .lower ().startswith (f"{ parsed .scheme } ://" )
6161 )
6262 ):
63- return URLParseResult (
63+ output = URLParseResult (
6464 scheme = "" ,
6565 netloc = "" ,
6666 path = "{}:{}" .format (
@@ -73,15 +73,19 @@ def safe_urlparse(href: str) -> URLParseResult:
7373 query = parsed .query ,
7474 fragment = parsed .fragment ,
7575 )
76+ print ("non-file scheme gives:" , output .path )
77+ return output
7678 if parsed .scheme == "file" and parsed .netloc :
77- return URLParseResult (
79+ output = URLParseResult (
7880 scheme = parsed .scheme ,
7981 netloc = "" ,
8082 path = f"{ parsed .netloc } { parsed .path } " ,
8183 params = parsed .params ,
8284 query = parsed .query ,
8385 fragment = parsed .fragment ,
8486 )
87+ print ("file scheme gives:" , output .path )
88+ return output
8589 else :
8690 return parsed
8791
@@ -215,10 +219,7 @@ def _make_relative_href_path(
215219 # posixpath doesn't play well with windows drive letters, so we have to use
216220 # the os-specific path library for the relpath function. This means we can
217221 # only handle windows paths on windows machines.
218- print ("start_dir: " , start_dir )
219- print ("source_path:" , source_path )
220222 relpath = make_posix_style (os .path .relpath (source_path , start_dir ))
221- print ("relpath:" , relpath )
222223
223224 # Ensure we retain a trailing slash from the original source path
224225 if parsed_source .path .endswith ("/" ):
0 commit comments