summaryrefslogtreecommitdiff
path: root/paste/util/quoting.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/util/quoting.py')
-rw-r--r--paste/util/quoting.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/paste/util/quoting.py b/paste/util/quoting.py
index 58ea308..b3d28a4 100644
--- a/paste/util/quoting.py
+++ b/paste/util/quoting.py
@@ -23,7 +23,10 @@ def html_quote(v, encoding=None):
if v is None:
return ''
elif isinstance(v, six.binary_type):
- return html.escape(v, 1)
+ if six.PY3:
+ return html.escape(v.decode(encoding), 1).encode(encoding)
+ else:
+ return html.escape(v, 1)
elif isinstance(v, six.text_type):
if six.PY3:
return html.escape(v, 1)