Fixing Issue6557. urllib.urlopen will quote the space character within urls.
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index c8410d1..0870b53 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -582,6 +582,17 @@
"url2pathname() failed; %s != %s" %
(expect, result))
+class URLopener_Tests(unittest.TestCase):
+ """Testcase to test the open method of URLopener class."""
+ def test_quoted_open(self):
+ class DummyURLopener(urllib.URLopener):
+ def open_spam(self, url):
+ return url
+
+ self.assertEqual(DummyURLopener().open(
+ 'spam://example/ /'),'//example/%20/')
+
+
# Just commented them out.
# Can't really tell why keep failing in windows and sparc.
# Everywhere else they work ok, but on those machines, someteimes
@@ -676,6 +687,7 @@
UnquotingTests,
urlencode_Tests,
Pathname_Tests,
+ URLopener_Tests,
#FTPWrapperTests,
)