Path.from_uri() doesn't work if the URI contains host component · Issue #123599 · python/cpython (original) (raw)

Bug report

Bug description:

Path.from_uri() introduced in Python 3.13 doesn't work properly if the URI contains a host component other than localhost. Following examples are run with Python 3.13 rc 1 on Linux with a machine having host name kone:

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 to RFC 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