diff options
author | Steve Dower <steve.dower@python.org> | 2019-06-04 15:55:30 (GMT) |
---|---|---|
committer | Ćukasz Langa <lukasz@langa.pl> | 2019-06-04 15:55:29 (GMT) |
commit | 8d0ef0b5edeae52960c7ed05ae8a12388324f87e (patch) | |
tree | 2efb997f81c7e84a3864f39157661cb0bf06f06f /Lib/urllib/parse.py | |
parent | 800d78637034d77c099d49c4fe99e1fe773da700 (diff) | |
download | cpython-8d0ef0b5edeae52960c7ed05ae8a12388324f87e.zip cpython-8d0ef0b5edeae52960c7ed05ae8a12388324f87e.tar.gz cpython-8d0ef0b5edeae52960c7ed05ae8a12388324f87e.tar.bz2 |
bpo-36742: Corrects fix to handle decomposition in usernames (#13812)
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r-- | Lib/urllib/parse.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index daefb20..b660878 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -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: |