bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017)

This commit is contained in:
Steve Dower 2019-04-30 12:03:02 +00:00 committed by GitHub
parent b84cb70880
commit d537ab0ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View file

@ -1011,6 +1011,12 @@ class UrlParseTestCase(unittest.TestCase):
self.assertIn('\u2100', denorm_chars)
self.assertIn('\uFF03', denorm_chars)
# bpo-36742: Verify port separators are ignored when they
# existed prior to decomposition
urllib.parse.urlsplit('http://\u30d5\u309a:80')
with self.assertRaises(ValueError):
urllib.parse.urlsplit('http://\u30d5\u309a\ufe1380')
for scheme in ["http", "https", "ftp"]:
for c in denorm_chars:
url = "{}://netloc{}false.netloc/path".format(scheme, c)