File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9292_UNSAFE_URL_BYTES_TO_REMOVE = ['\t ' , '\r ' , '\n ' ]
9393
9494# Zone ID regex as defined in RFC 6874
95- zone_id_regex = re .compile (r"(%[a-fA-F0-9]{2}|[\w\.~-])+" )
95+ zone_id_regex = re .compile (r"(%[a-fA-F0-9]{2}|[\w\.~-])+" , flags = re . ASCII )
9696
9797def clear_cache ():
9898 """Clear internal performance caches. Undocumented; some tests want it."""
@@ -469,7 +469,7 @@ def _check_bracketed_host(hostname):
469469 ip = ipaddress .ip_address (hostname ) # Throws Value Error if not IPv6 or IPv4
470470 if isinstance (ip , ipaddress .IPv4Address ):
471471 raise ValueError ("An IPv4 address cannot be in brackets" )
472- if "%" in hostname and not zone_id_regex .fullmatch (hostname .split ("%" , 1 )[1 ], flags = re . ASCII ):
472+ if "%" in hostname and not zone_id_regex .fullmatch (hostname .split ("%" , 1 )[1 ]):
473473 raise ValueError ("IPv6 ZoneID is invalid" )
474474
475475# typed=True avoids BytesWarnings being emitted during cache key
You can’t perform that action at this time.
0 commit comments