Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.

Fix by John Nagle.
This commit is contained in:
Guido van Rossum 2008-01-05 22:19:06 +00:00
parent 3001c5463e
commit c6a04c2629
3 changed files with 13 additions and 7 deletions

View file

@ -316,6 +316,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)