Skip to content

Commit

Permalink
Improve news in light of pythonGH-127217
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Nov 24, 2024
1 parent 5e1b65f commit 5396ef2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Lib/nturl2path.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def pathname2url(p):
drive = f'///{drive}'
drive = urllib.parse.quote(drive, safe='/:')
elif root:
# Path has a root but no drive. Add an authority section.
# Add explicitly empty authority to path beginning with one slash.
root = f'//{root}'

tail = urllib.parse.quote(tail)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:func:`urllib.request.pathname2url` now adds an empty authority when
generating a URL for an absolute POSIX path. For example, the path
``/etc/hosts`` is converted to the scheme-less URL ``///etc/hosts``. As a
result of this change, URLs without authorities are only generated for
generating a URL for a path that begins with exactly one slash. For example,
the path ``/etc/hosts`` is converted to the scheme-less URL ``///etc/hosts``.
As a result of this change, URLs without authorities are only generated for
relative paths.

0 comments on commit 5396ef2

Please sign in to comment.