Skip to content
Merged
Prev Previous commit
Next Next commit
Expand the constant instead of computing it at import time.
  • Loading branch information
gpshead authored Apr 27, 2023
commit a13bf41219b239511267a307703221f7c05514a4
3 changes: 2 additions & 1 deletion Lib/urllib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
'+-.')

# Leading and trailing C0 control and space to be stripped per WHATWG spec
_URL_CHARS_TO_STRIP = "".join([chr(i) for i in range(0, 0x20 + 1)])
# == "".join([chr(i) for i in range(0, 0x20 + 1)])
_URL_CHARS_TO_STRIP = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f '

# Unsafe bytes to be removed per WHATWG spec
_UNSAFE_URL_BYTES_TO_REMOVE = ['\t', '\r', '\n']
Expand Down