Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
On Windows,urllib.request.url2pathname() mishandles an uncommon file URI variant encoding a UNC path. Specifically, a URI withfive leading slashes should be converted to a UNC path withtwo leading slashes, buturl2pathname() returns a path withthree leading slashes. Such URIs are created by software that simply prependsfile:/// to a Windows path. SeeRFC 8089 E.3.2, final example.
>>>fromurllib.requestimporturl2pathname>>>url2pathname('/////server/share')'\\\\\\server\\share'# expected: '\\\\server\\share'
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows