Issue #10836: Fix exception raised when file not found in urlretrieve

This commit is contained in:
Senthil Kumaran 2012-10-21 13:30:02 -07:00
parent 8a915499f6
commit f577686fd3
3 changed files with 10 additions and 2 deletions

View file

@ -268,6 +268,11 @@ Content-Type: text/html; charset=iso-8859-1
finally:
self.unfakehttp()
def test_missing_localfile(self):
# Test for #10836
with self.assertRaises(urllib.error.URLError):
urlopen('file://localhost/a/file/which/doesnot/exists.py')
def test_userpass_inurl(self):
self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
try: