summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-13 08:14:27 (GMT)
committerGeorg Brandl <georg@python.org>2007-03-13 08:14:27 (GMT)
commitceede5c35988264ac2ca012c07a06270f992ac09 (patch)
tree81f53ea9807a67b3def61b5de702e852e869cc8e /Lib/test
parent8f032cbb05b3eb6cc5452f96282523fb1a7a3077 (diff)
downloadcpython-ceede5c35988264ac2ca012c07a06270f992ac09.zip
cpython-ceede5c35988264ac2ca012c07a06270f992ac09.tar.gz
cpython-ceede5c35988264ac2ca012c07a06270f992ac09.tar.bz2
Patch #1668100: urllib2 now correctly raises URLError instead of
OSError if accessing a local file via the file:// protocol fails.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_urllib2.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 5ca760e..a23d61e 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -626,11 +626,11 @@ class HandlerTests(unittest.TestCase):
for url in [
"file://localhost:80%s" % urlpath,
-# XXXX bug: these fail with socket.gaierror, should be URLError
-## "file://%s:80%s/%s" % (socket.gethostbyname('localhost'),
-## os.getcwd(), TESTFN),
-## "file://somerandomhost.ontheinternet.com%s/%s" %
-## (os.getcwd(), TESTFN),
+ "file:///file_does_not_exist.txt",
+ "file://%s:80%s/%s" % (socket.gethostbyname('localhost'),
+ os.getcwd(), TESTFN),
+ "file://somerandomhost.ontheinternet.com%s/%s" %
+ (os.getcwd(), TESTFN),
]:
try:
f = open(TESTFN, "wb")