You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
barneygale opened this issue
Nov 14, 2024
· 1 comment
Labels
3.12bugs and security fixes3.13bugs and security fixes3.14new features, bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
… on POSIX
Adjust `urllib.request.url2pathname()` to parse the URL authority and path
with `urlsplit()` on POSIX. If the authority is empty or resolves to the
current host, it is ignored and the URL path is used as the pathname.
If not, we raise `URLError`.
3.12bugs and security fixes3.13bugs and security fixes3.14new features, bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
Bug report
Bug description:
URLs supplied to
urllib.request.url2pathname()
may include a non-empty authority (netloc), such as a hostname.On Windows, these are correctly decoded (mostly):
But on POSIX, any non-empty authority except
localhost
is preserved in the path:Per RFC 8089 this isn't correct.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
url2pathname()
: handle non-empty authority section on POSIX #126844The text was updated successfully, but these errors were encountered: