mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-36742: Corrects fix to handle decomposition in usernames (#13812)
This commit is contained in:
parent
800d786370
commit
8d0ef0b5ed
2 changed files with 9 additions and 8 deletions
|
@ -402,9 +402,9 @@ def _checknetloc(netloc):
|
|||
# looking for characters like \u2100 that expand to 'a/c'
|
||||
# IDNA uses NFKC equivalence, so normalize for this check
|
||||
import unicodedata
|
||||
n = netloc.rpartition('@')[2] # ignore anything to the left of '@'
|
||||
n = n.replace(':', '') # ignore characters already included
|
||||
n = n.replace('#', '') # but not the surrounding text
|
||||
n = netloc.replace('@', '') # ignore characters already included
|
||||
n = n.replace(':', '') # but not the surrounding text
|
||||
n = n.replace('#', '')
|
||||
n = n.replace('?', '')
|
||||
netloc2 = unicodedata.normalize('NFKC', n)
|
||||
if n == netloc2:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue