]> granicus.if.org Git - python/commitdiff
Backport r59758.
authorGuido van Rossum <guido@python.org>
Sat, 5 Jan 2008 23:34:38 +0000 (23:34 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 5 Jan 2008 23:34:38 +0000 (23:34 +0000)
Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
Fix by John Nagle.

Lib/test/test_urlparse.py

index dcb89f763bd3c5e3bf4c92d2ed7e415d3874c4b4..927b1e841b1c3a44cc2335a9044aef7680d59e1e 100644 (file)
@@ -298,6 +298,11 @@ class UrlParseTestCase(unittest.TestCase):
         self.assertEqual(type(p.hostname), type(uri))
         self.assertEqual(type(p.path), type(uri))
 
+    def test_noslash(self):
+        # Issue 1637: http://foo.com?query is legal
+        self.assertEqual(urlparse.urlparse("http://example.com?blahblah=/foo"),
+                         ('http', 'example.com', '', '', 'blahblah=/foo', ''))
+
 def test_main():
     test_support.run_unittest(UrlParseTestCase)