summaryrefslogtreecommitdiff
path: root/Lib/urllib/parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r--Lib/urllib/parse.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index 791b457bfb..fa8827a9fa 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -397,9 +397,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: