summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-10-21 20:30:02 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-10-21 20:30:02 (GMT)
commitf577686fd3c4a78bb1fe881a872731600ec7c3b6 (patch)
treebd6b05ccca5a3f6dbd8843f024d09c7141292b0c /Lib/test/test_urllib.py
parent8a915499f65cb9477483e4af23f93825edaa1d25 (diff)
downloadcpython-f577686fd3c4a78bb1fe881a872731600ec7c3b6.zip
cpython-f577686fd3c4a78bb1fe881a872731600ec7c3b6.tar.gz
cpython-f577686fd3c4a78bb1fe881a872731600ec7c3b6.tar.bz2
Issue #10836: Fix exception raised when file not found in urlretrieve
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r--Lib/test/test_urllib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 22ada56..5721296 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -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: