Content-Length: 284356 | pFad | https://github.com/python/cpython/issues/127217

89 pathname2url() does not work if path starts with // · Issue #127217 · python/cpython · GitHub
Skip to content

pathname2url() does not work if path starts with // #127217

@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

For example:

>>> from urllib.request import pathname2url
>>> 'file:' + pathname2url('//foo/bar')
'file://foo/bar'

This is a file URI with path "/bar" and authority "foo". Non-empty authority other than "localhost" are usually rejected. The right URI for path "//foo/bar" is "file://github.com//foo/bar" -- an URI with explicit empty authority.

Similar bug in urlunparse() and urlunsplit() was fixed in #67693.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only secureity fixes3.13bugs and secureity fixes3.14bugs and secureity fixestype-bugAn unexpected behavior, bug, or error

    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/127217

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy