Content-Length: 305921 | pFad | https://github.com/python/cpython/issues/125866

ad Improve file URI ergonomics in `urllib.request` · Issue #125866 · python/cpython · GitHub
Skip to content

Improve file URI ergonomics in urllib.request #125866

Description

@barneygale

Feature or enhancement

I request that we make pathname2url and url2pathname easier to use:

  • pathname2url() is made to accept an optional include_scheme argument that sticks file: on the front when true
  • url2pathname() is made to strip any file: prefix from its argument.

I think this would go a long way towards making these functions usable, and allow us to remove the scary "This does not accept/produce a complete URL" warnings from the docs.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/125866

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy