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 @@ -994,11 +994,12 @@ def test_urlsplit_normalization(self):
994994 urllib .parse .urlsplit ('http://\u30d5 \u309a \ufe13 80' )
995995
996996 for scheme in ["http" , "https" , "ftp" ]:
997- for c in denorm_chars :
998- url = "{}://netloc{}false.netloc/path" .format (scheme , c )
999- with self .subTest (url = url , char = '{:04X}' .format (ord (c ))):
1000- with self .assertRaises (ValueError ):
1001- urllib .parse .urlsplit (url )
997+ for netloc in ["netloc{}false.netloc" , "n{}user@netloc" ]:
998+ for c in denorm_chars :
999+ url = "{}://{}/path" .format (scheme , netloc .format (c ))
1000+ with self .subTest (url = url , char = '{:04X}' .format (ord (c ))):
1001+ with self .assertRaises (ValueError ):
1002+ urllib .parse .urlsplit (url )
10021003
10031004class Utility_Tests (unittest .TestCase ):
10041005 """Testcase to test the various utility functions in the urllib."""
Original file line number Diff line number Diff line change @@ -333,9 +333,9 @@ def _checknetloc(netloc):
333333 # looking for characters like \u2100 that expand to 'a/c'
334334 # IDNA uses NFKC equivalence, so normalize for this check
335335 import unicodedata
336- n = netloc .rpartition ('@' )[ 2 ] # ignore anything to the left of '@'
337- n = n .replace (':' , '' ) # ignore characters already included
338- n = n .replace ('#' , '' ) # but not the surrounding text
336+ n = netloc .replace ('@' , '' ) # ignore characters already included
337+ n = n .replace (':' , '' ) # but not the surrounding text
338+ n = n .replace ('#' , '' )
339339 n = n .replace ('?' , '' )
340340 netloc2 = unicodedata .normalize ('NFKC' , n )
341341 if n == netloc2 :
You can’t perform that action at this time.
0 commit comments