urllib.request.pathname2url()
: generate RFC 1738 URLs where possible
#127236
Labels
urllib.request.pathname2url()
: generate RFC 1738 URLs where possible
#127236
Feature or enhancement
Proposal:
urllib.request.pathname2url
currently generates RFC 1738-compliantfile:
URIs in the following cases://
(since pathname2url() does not work if path starts with // #127217)This function cannot generate RFC 1738-compliant URLs for:
That leaves one case where the function could generate RFC 1738-compatible URLs, but doesn't:
For consistency with
pathname2url()
's handling of other paths, and consistency withpathlib.Path.as_uri()
, I propose we prepend two slashes to any path beginning with precisely one slash to produce a URL authority section with a zero-length authority.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
#125866 (comment)
Linked PRs
pathname2url()
: generate RFC 1738 URL for absolute POSIX path #127194The text was updated successfully, but these errors were encountered: