Skip to content

Commit 9864ce1

Browse files
gh-137146: Fix unicode characters in PIvFuture
1 parent 9790b02 commit 9864ce1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/urllib/parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def _check_bracketed_netloc(netloc):
460460
# https://www.rfc-editor.org/rfc/rfc3986#page-49 and https://url.spec.whatwg.org/
461461
def _check_bracketed_host(hostname):
462462
if hostname.startswith('v'):
463-
if not re.match(r"\Av[a-fA-F0-9]+\.[\w\.~!$&*+,;=:'()-]+\z", hostname):
463+
if not re.match(r"\Av[a-fA-F0-9]+\.[\w\.~!$&*+,;=:'()-]+\z", hostname, flags=re.ASCII):
464464
raise ValueError(f"IPvFuture address is invalid")
465465
else:
466466
ip = ipaddress.ip_address(hostname) # Throws Value Error if not IPv6 or IPv4

0 commit comments

Comments
 (0)