diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-23 23:51:05 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-23 23:51:05 +0200 |
| commit | b49efe0bb4cbb6a6b521a6a860fa619e4293aafb (patch) | |
| tree | 8e48f2ca42296087c5ac41a6c75f284d6db54aa1 /paste | |
| parent | ed7cf116c6f2bb9cadcb33e61fdf7a21bc1fde87 (diff) | |
| download | paste-b49efe0bb4cbb6a6b521a6a860fa619e4293aafb.tar.gz | |
Revert change on paste.util.quoting.html_quote()
On Python 2, html_quote(unicode) returns again bytes to restore backward
compatibility.
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 9bd50c8..df0d9da 100644 --- a/paste/util/quoting.py +++ b/paste/util/quoting.py @@ -24,7 +24,10 @@ def html_quote(v, encoding=None): elif isinstance(v, six.binary_type): return cgi.escape(v, 1) elif isinstance(v, six.text_type): - return cgi.escape(v, 1) + if six.PY3: + return cgi.escape(v, 1) + else: + return cgi.escape(v.encode(encoding), 1) else: if six.PY3: return cgi.escape(six.text_type(v), 1) |
