mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Fix issue #1313119: urlparse "caches" parses regardless of encoding
This commit is contained in:
parent
adf9ffdfbe
commit
2f9ca29d10
2 changed files with 11 additions and 1 deletions
|
@ -287,6 +287,16 @@ class UrlParseTestCase(unittest.TestCase):
|
|||
self.assertEqual(p.port, None)
|
||||
self.assertEqual(p.geturl(), uri)
|
||||
|
||||
def test_caching(self):
|
||||
# Test case for bug #1313119
|
||||
uri = "http://example.com/doc/"
|
||||
unicode_uri = unicode(uri)
|
||||
|
||||
urlparse.urlparse(unicode_uri)
|
||||
p = urlparse.urlparse(uri)
|
||||
self.assertEqual(type(p.scheme), type(uri))
|
||||
self.assertEqual(type(p.hostname), type(uri))
|
||||
self.assertEqual(type(p.path), type(uri))
|
||||
|
||||
def test_main():
|
||||
test_support.run_unittest(UrlParseTestCase)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue