diff --git a/debug_webserver.py b/debug_webserver.py index 87f7eaed0..1825c7717 100644 --- a/debug_webserver.py +++ b/debug_webserver.py @@ -18,7 +18,7 @@ output_lock = threading.Lock() output_data_path = pathlib.Path(tempfile.gettempdir()) / f'{appname}' / 'http_debug' -SAFE_TRANSLATE = str.maketrans({x: '_' for x in "!@#$%^&*()./\\\r\n[]-+='\";:?<>,~`"}) +SAFE_TRANSLATE = str.maketrans(dict.fromkeys("!@#$%^&*()./\\\r\n[]-+='\";:?<>,~`", '_')) class LoggingHandler(server.BaseHTTPRequestHandler):