+9
-8
lines changedFilter options
+9
-8
lines changed Original file line number Diff line number Diff line change
@@ -1008,11 +1008,12 @@ def test_urlsplit_normalization(self):
1008
1008
urllib.parse.urlsplit('http://\u30d5\u309a\ufe1380')
1009
1009
1010
1010
for scheme in ["http", "https", "ftp"]:
1011
-
for c in denorm_chars:
1012
-
url = "{}://netloc{}false.netloc/path".format(scheme, c)
1013
-
with self.subTest(url=url, char='{:04X}'.format(ord(c))):
1014
-
with self.assertRaises(ValueError):
1015
-
urllib.parse.urlsplit(url)
1011
+
for netloc in ["netloc{}false.netloc", "n{}user@netloc"]:
1012
+
for c in denorm_chars:
1013
+
url = "{}://{}/path".format(scheme, netloc.format(c))
1014
+
with self.subTest(url=url, char='{:04X}'.format(ord(c))):
1015
+
with self.assertRaises(ValueError):
1016
+
urllib.parse.urlsplit(url)
1016
1017
1017
1018
class Utility_Tests(unittest.TestCase):
1018
1019
"""Testcase to test the various utility functions in the urllib."""
Original file line number Diff line number Diff line change
@@ -397,9 +397,9 @@ def _checknetloc(netloc):
397
397
# looking for characters like \u2100 that expand to 'a/c'
398
398
# IDNA uses NFKC equivalence, so normalize for this check
399
399
import unicodedata
400
-
n = netloc.rpartition('@')[2] # ignore anything to the left of '@'
401
-
n = n.replace(':', '') # ignore characters already included
402
-
n = n.replace('#', '') # but not the surrounding text
400
+
n = netloc.replace('@', '') # ignore characters already included
401
+
n = n.replace(':', '') # but not the surrounding text
402
+
n = n.replace('#', '')
403
403
n = n.replace('?', '')
404
404
netloc2 = unicodedata.normalize('NFKC', n)
405
405
if n == netloc2:
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4