]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-123599: `url2pathname()`: don't call `gethostbyname()` by default (#132610)
authorBarney Gale <barney.gale@gmail.com>
Mon, 5 May 2025 17:03:42 +0000 (18:03 +0100)
committerGitHub <noreply@github.com>
Mon, 5 May 2025 17:03:42 +0000 (17:03 +0000)
commit8e08ac9f32d89bf387c75bb6d0710a7b59026b5b
tree2cd5c576ba496772d5b60802f1520da65e5e5114
parent082dbf77884264a8470b1ea132cc458d0b5bf08a
GH-123599: `url2pathname()`: don't call `gethostbyname()` by default (#132610)

Follow-up to 66cdb2bd8ab93a4691bead7f5d1e54e5ca6895b4.

Add *resolve_host* keyword-only argument to `url2pathname()`, defaulting to
false. When set to true, we call `socket.gethostbyname()` to resolve the
URL hostname.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Doc/library/pathlib.rst
Doc/library/urllib.request.rst
Doc/whatsnew/3.14.rst
Lib/test/test_pathlib/test_pathlib.py
Lib/test/test_urllib.py
Lib/urllib/request.py
Misc/NEWS.d/next/Library/2024-11-14-21-17-48.gh-issue-126838.Yr5vKF.rst