diff options
| author | Jelmer Vernooij <jelmer@jelmer.uk> | 2019-03-07 02:51:12 -0800 |
|---|---|---|
| committer | Chris Dent <chris.dent@gmail.com> | 2019-03-07 10:51:12 +0000 |
| commit | 1cccef8ca1257b36d33ac48563b3ea996575c550 (patch) | |
| tree | 25a4585152efe744be6e65fefb436fcaf0b21a5b /paste | |
| parent | 4bd9871effb3192fa1973ef2cafa1923eaa0ff01 (diff) | |
| download | paste-git-1cccef8ca1257b36d33ac48563b3ea996575c550.tar.gz | |
Fix quoting of bytestrings. (#23)
Diffstat (limited to 'paste')
| -rw-r--r-- | paste/util/quoting.py | 5 |
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) |
