Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed as not planned
Closed as not planned
Description
Bug report
Bug description:
URLs supplied tourllib.request.url2pathname() may include a non-empty authority (netloc), such as a hostname.
On Windows, these are correctly decoded (mostly):
>>>url2pathname('//localhost/c:/foo.txt')'C:\\foo.txt'# OK>>>url2pathname('//server/share')'\\\\server\\share'# OK
But on POSIX, any non-empty authority exceptlocalhost is preserved in the path:
>>>url2pathname('//myhostname/etc/hosts')'//myhostname/etc/hosts'# expected '/etc/hosts'>>>url2pathname('//server/share')'//server/share'# expected URLError ('server' is not local)
PerRFC 8089 this isn't correct.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux