You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
urllib.request.pathname2url() and url2pathname() remove slashes on Windows #126212
urllib.request.pathname2url() unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths):
>>>fromurllib.requestimportpathname2url, url2pathname>>>pathname2url('C:\\')
'///C:'# This is *not* the same path!>>>pathname2url('C:\\foo\\')
'///C:/foo'>>>pathname2url('C:\\foo\\\\bar')
'///C:/foo/bar'
url2pathname() does almost the same thing, except that it specially preserves a slash immediately after a DOS drive (but not elsewhere):
Activity
pythonGH-126212: Fix removal of slashes in file URIs on Windows
GH-126212: Fix removal of slashes in file URIs on Windows (#126214)
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…
[3.12] GH-126212: Fix removal of slashes in file URIs on Windows (GH-…
[3.13] GH-126212: Fix removal of slashes in file URIs on Windows (GH-…
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…