aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_pathlib/test_pathlib.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2025-05-05 18:03:42 +0100
committerGitHub <noreply@github.com>2025-05-05 17:03:42 +0000
commit8e08ac9f32d89bf387c75bb6d0710a7b59026b5b (patch)
tree2cd5c576ba496772d5b60802f1520da65e5e5114 /Lib/test/test_pathlib/test_pathlib.py
parent082dbf77884264a8470b1ea132cc458d0b5bf08a (diff)
downloadcpython-8e08ac9f32d89bf387c75bb6d0710a7b59026b5b.tar.gz
cpython-8e08ac9f32d89bf387c75bb6d0710a7b59026b5b.zip
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>
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib/test_pathlib.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py
index 41a79d0dceb..e23dac3c25f 100644
--- a/Lib/test/test_pathlib/test_pathlib.py
+++ b/Lib/test/test_pathlib/test_pathlib.py
@@ -3290,7 +3290,6 @@ class PathTest(PurePathTest):
self.assertEqual(P.from_uri('file:////foo/bar'), P('//foo/bar'))
self.assertEqual(P.from_uri('file://localhost/foo/bar'), P('/foo/bar'))
if not is_wasi:
- self.assertEqual(P.from_uri('file://127.0.0.1/foo/bar'), P('/foo/bar'))
self.assertEqual(P.from_uri(f'file://{socket.gethostname()}/foo/bar'),
P('/foo/bar'))
self.assertRaises(ValueError, P.from_uri, 'foo/bar')