File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1680,7 +1680,6 @@ def pathname2url(pathname):
16801680 pathname = pathname .replace ('\\ ' , '/' )
16811681 encoding = sys .getfilesystemencoding ()
16821682 errors = sys .getfilesystemencodeerrors ()
1683- prefix = ''
16841683 drive , root , tail = os .path .splitroot (pathname )
16851684 if drive :
16861685 # First, clean up some special forms. We are going to sacrifice the
@@ -1693,16 +1692,16 @@ def pathname2url(pathname):
16931692 # DOS drive specified. Add three slashes to the start, producing
16941693 # an authority section with a zero-length authority, and a path
16951694 # section starting with a single slash.
1696- prefix = '///'
1695+ drive = '///' + drive
16971696 drive = quote (drive , encoding = encoding , errors = errors , safe = '/:' )
16981697 elif root :
16991698 # Add explicitly empty authority to absolute path. If the path
17001699 # starts with exactly one slash then this change is mostly
17011700 # cosmetic, but if it begins with two or more slashes then this
17021701 # avoids interpreting the path as a URL authority.
1703- prefix = '//'
1702+ root = '//' + root
17041703 tail = quote (tail , encoding = encoding , errors = errors )
1705- return prefix + drive + root + tail
1704+ return drive + root + tail
17061705
17071706
17081707# Utility functions
You can’t perform that action at this time.
0 commit comments