File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1018,11 +1018,12 @@ def test_urlsplit_normalization(self):
10181018 urllib .parse .urlsplit ('http://\u30d5 \u309a \ufe13 80' )
10191019
10201020 for scheme in ["http" , "https" , "ftp" ]:
1021- for c in denorm_chars :
1022- url = "{}://netloc{}false.netloc/path" .format (scheme , c )
1023- with self .subTest (url = url , char = '{:04X}' .format (ord (c ))):
1024- with self .assertRaises (ValueError ):
1025- urllib .parse .urlsplit (url )
1021+ for netloc in ["netloc{}false.netloc" , "n{}user@netloc" ]:
1022+ for c in denorm_chars :
1023+ url = "{}://{}/path" .format (scheme , netloc .format (c ))
1024+ with self .subTest (url = url , char = '{:04X}' .format (ord (c ))):
1025+ with self .assertRaises (ValueError ):
1026+ urllib .parse .urlsplit (url )
10261027
10271028class Utility_Tests (unittest .TestCase ):
10281029 """Testcase to test the various utility functions in the urllib."""
Original file line number Diff line number Diff line change @@ -402,9 +402,9 @@ def _checknetloc(netloc):
402402 # looking for characters like \u2100 that expand to 'a/c'
403403 # IDNA uses NFKC equivalence, so normalize for this check
404404 import unicodedata
405- n = netloc .rpartition ('@' )[ 2 ] # ignore anything to the left of '@'
406- n = n .replace (':' , '' ) # ignore characters already included
407- n = n .replace ('#' , '' ) # but not the surrounding text
405+ n = netloc .replace ('@' , '' ) # ignore characters already included
406+ n = n .replace (':' , '' ) # but not the surrounding text
407+ n = n .replace ('#' , '' )
408408 n = n .replace ('?' , '' )
409409 netloc2 = unicodedata .normalize ('NFKC' , n )
410410 if n == netloc2 :
You can’t perform that action at this time.
0 commit comments