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 @@ -1008,11 +1008,12 @@ def test_urlsplit_normalization(self):
10081008 urllib .parse .urlsplit ('http://\u30d5 \u309a \ufe13 80' )
10091009
10101010 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 )
10161017
10171018class Utility_Tests (unittest .TestCase ):
10181019 """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):
397397 # looking for characters like \u2100 that expand to 'a/c'
398398 # IDNA uses NFKC equivalence, so normalize for this check
399399 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 ('#' , '' )
403403 n = n .replace ('?' , '' )
404404 netloc2 = unicodedata .normalize ('NFKC' , n )
405405 if n == netloc2 :
You can’t perform that action at this time.
0 commit comments