From: Guido van Rossum Date: Sat, 5 Jan 2008 23:34:38 +0000 (+0000) Subject: Backport r59758. X-Git-Tag: v2.5.2c1~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81728cf4c9d75fdef024d235d9ab15cf0e6ead30;p=python Backport r59758. Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'. Fix by John Nagle. --- diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index dcb89f763b..927b1e841b 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -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)