summaryrefslogtreecommitdiff
path: root/wsgitools/filters.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/filters.py')
-rw-r--r--wsgitools/filters.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wsgitools/filters.py b/wsgitools/filters.py
index 7062357..1c3fadc 100644
--- a/wsgitools/filters.py
+++ b/wsgitools/filters.py
@@ -203,9 +203,10 @@ class WSGIFilterMiddleware:
# Using map and lambda here since pylint cannot handle list comprehension in
# default arguments. Also note that neither ' nor " are considered printable.
+# For escape_string to be reversible \ is also not considered printable.
def escape_string(string, replacer=list(map(
lambda i: chr(i) if chr(i).isalnum() or
- chr(i) in '!#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ' else
+ chr(i) in '!#$%&()*+,-./:;<=>?@[]^_`{|}~ ' else
r"\x%2.2x" % i,
range(256)))):
"""Encodes non-printable characters in a string using \\xXX escapes.