We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
urlopen()
1 parent 666eeda commit f3192daCopy full SHA for f3192da
Lib/test/test_urllib.py
@@ -181,6 +181,16 @@ def test_iter(self):
181
def test_relativelocalfile(self):
182
self.assertRaises(ValueError,urllib.request.urlopen,'./' + self.pathname)
183
184
+ def test_remote_authority(self):
185
+ # Test for GH-90812.
186
+ url = 'file://pythontest.net/foo/bar'
187
+ with self.assertRaises(urllib.error.URLError) as e:
188
+ urllib.request.urlopen(url)
189
+ if os.name == 'nt':
190
+ self.assertEqual(e.exception.filename, r'\\pythontest.net\foo\bar')
191
+ else:
192
+ self.assertEqual(e.exception.reason, 'file:// scheme is supported only on localhost')
193
+
194
195
class ProxyTests(unittest.TestCase):
196
0 commit comments