Skip to content

Commit

Permalink
also escape \s (backport of PR python#100038).
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Dec 5, 2022
1 parent 69f5f37 commit 60779c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Lib/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ def log_error(self, format, *args):
# https://en.wikipedia.org/wiki/List_of_Unicode_characters#Control_codes
_control_char_table = str.maketrans(
{c: fr'\x{c:02x}' for c in itertools.chain(range(0x20), range(0x7f,0xa0))})
_control_char_table[ord('\\')] = r'\\'

def log_message(self, format, *args):
"""Log an arbitrary message.
Expand Down

0 comments on commit 60779c3

Please sign in to comment.