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 ccad61e commit d9e0939Copy full SHA for d9e0939
Lib/test/test_urllib.py
@@ -183,6 +183,17 @@ def test_iter(self):
183
def test_relativelocalfile(self):
184
self.assertRaises(ValueError,urllib.request.urlopen,'./' + self.pathname)
185
186
+ def test_remote_authority(self):
187
+ # Test for GH-90812.
188
+ url = 'file://pythontest.net/foo/bar'
189
+ with self.assertRaises(urllib.error.URLError) as e:
190
+ urllib.request.urlopen(url)
191
+ if os.name == 'nt':
192
+ self.assertEqual(e.exception.reason, 'File not found')
193
+ self.assertEqual(e.exception.filename, r'\\pythontest.net\foo\bar')
194
+ else:
195
+ self.assertEqual(e.exception.reason, 'file:// scheme is supported only on localhost')
196
+
197
198
class ProxyTests(unittest.TestCase):
199
0 commit comments