cpython/Lib/urllib
Barney Gale 5bb059fe60
GH-127236: `pathname2url()`: generate RFC 1738 URL for absolute POSIX path (#127194)
When handed an absolute Windows path such as `C:\foo` or `//server/share`,
the `urllib.request.pathname2url()` function returns a URL with an
authority section, such as `///C:/foo` or `//server/share` (or before
GH-126205, `////server/share`). Only the `file:` prefix is omitted.

But when handed an absolute POSIX path such as `/etc/hosts`, or a Windows
path of the same form (rooted but lacking a drive), the function returns a
URL without an authority section, such as `/etc/hosts`.

This patch corrects the discrepancy by adding a `//` prefix before
drive-less, rooted paths when generating URLs.
2024-11-25 19:59:20 +00:00
..
__init__.py
error.py
parse.py gh-126662: harmonize naming for three namedtuple base classes in urllib.parse (GH-126663) 2024-11-23 18:36:48 -08:00
request.py GH-127236: `pathname2url()`: generate RFC 1738 URL for absolute POSIX path (#127194) 2024-11-25 19:59:20 +00:00
response.py
robotparser.py