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:
Path.from_uri() introduced in Python 3.13 doesn't work properly if the URI contains a host component other thanlocalhost. Following examples are run with Python 3.13 rc 1 on Linux with a machine having host namekone:
>>>print(Path().from_uri('file:///home/peke/test'))/home/peke/test>>>print(Path().from_uri('file://localhost/home/peke/test'))/home/peke/test>>>print(Path().from_uri(f'file://{socket.getfqdn()}/home/peke/test'))//kone/home/peke/test
According toRFC 8089 including the host component as a fully qualified name is fine so this looks like a bug to me.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- GH-123599: Reject non-local authority in
pathlib.Path.from_uri()on POSIX #123650 - GH-123599:
url2pathname(): handle authority section in file URL #126844 - GH-123599: Remove duplicate
url2pathname()implementation #127237 - GH-123599: Deprecate duplicate
pathname2url()implementation #127380 - GH-123599: Match
file:URL hostname against machine hostname in urllib #132523 - GH-123599:
url2pathname(): don't callgethostbyname()by default #132610