https://github.com/python/cpython/commit/f3192dac669ce14016efcec267ef331108d6b442 commit: f3192dac669ce14016efcec267ef331108d6b442 branch: main author: Barney Gale <barney.g...@gmail.com> committer: barneygale <barney.g...@gmail.com> date: 2025-04-15T19:16:34+01:00 summary:
GH-90812: Add test for `urlopen()` of file URI for UNC path (#132489) files: M Lib/test/test_urllib.py diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index da3db2f4e550fb..90de828cc71249 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -181,6 +181,16 @@ def test_iter(self): def test_relativelocalfile(self): self.assertRaises(ValueError,urllib.request.urlopen,'./' + self.pathname) + def test_remote_authority(self): + # Test for GH-90812. + url = 'file://pythontest.net/foo/bar' + with self.assertRaises(urllib.error.URLError) as e: + urllib.request.urlopen(url) + if os.name == 'nt': + self.assertEqual(e.exception.filename, r'\\pythontest.net\foo\bar') + else: + self.assertEqual(e.exception.reason, 'file:// scheme is supported only on localhost') + class ProxyTests(unittest.TestCase): _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com