]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-125866: Support complete "file:" URLs in urllib (#132378)
authorBarney Gale <barney.gale@gmail.com>
Mon, 14 Apr 2025 00:49:02 +0000 (01:49 +0100)
committerGitHub <noreply@github.com>
Mon, 14 Apr 2025 00:49:02 +0000 (01:49 +0100)
commitccad61e35d240972d14f993507566706fbf419f1
tree05a920c319a1a3aca905d95bd57af515ca6e6608
parent4d3ad0467e5cb145b1f4bde4be5eb776946a4269
GH-125866: Support complete "file:" URLs in urllib (#132378)

Add optional *add_scheme* argument to `urllib.request.pathname2url()`; when
set to true, a complete URL is returned. Likewise add optional
*require_scheme* argument to `url2pathname()`; when set to true, a complete
URL is accepted.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Doc/library/urllib.request.rst
Doc/whatsnew/3.14.rst
Lib/pathlib/__init__.py
Lib/test/test_pathlib/test_pathlib.py
Lib/test/test_urllib.py
Lib/test/test_urllib2.py
Lib/test/test_urllib2net.py
Lib/urllib/request.py
Misc/NEWS.d/next/Library/2025-04-10-21-43-04.gh-issue-125866.EZ9X8D.rst [new file with mode: 0644]