-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
On Windows, urllib.request.url2pathname()
mishandles an uncommon file URI variant encoding a UNC path. Specifically, a URI with five leading slashes should be converted to a UNC path with two leading slashes, but url2pathname()
returns a path with three leading slashes. Such URIs are created by software that simply prepends file:///
to a Windows path. See RFC 8089 E.3.2, final example.
>>> from urllib.request import url2pathname
>>> url2pathname('/////server/share')
'\\\\\\server\\share' # expected: '\\\\server\\share'
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error