diff options
author | Chris Dent <cdent@anticdent.org> | 2018-10-23 17:01:47 +0100 |
---|---|---|
committer | Chris Dent <cdent@anticdent.org> | 2018-10-23 17:01:47 +0100 |
commit | 9fcc98bd3e5bde3a26326f3156845093f84b8832 (patch) | |
tree | f0e7f4980c56e3f296daa1649ae7232bd0e32dd7 /paste/util/quoting.py | |
parent | 9a873a24759f69d6414042abdfc2fde21f8cca21 (diff) | |
download | paste-git-9fcc98bd3e5bde3a26326f3156845093f84b8832.tar.gz |
Fix up testing after switch to pytest
pytest exposes many warnings, some but not all of which are cleaned
up here. The main switch is to use html.escape instead of cgi.escape.
This inspired the addition of 'future' to requirements.
The remaining warnings are related to pytest deprecations or over-eager
test discovery.
It is perhaps ironic that the switch to pytest is to avoid nose being
mostly dead, and now we are using features in pytest that pytest wants
to make dead. These are left for later cleanups, which means that
running the tests is noisy.
Diffstat (limited to 'paste/util/quoting.py')
-rw-r--r-- | paste/util/quoting.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/paste/util/quoting.py b/paste/util/quoting.py index df0d9da..c1f635f 100644 --- a/paste/util/quoting.py +++ b/paste/util/quoting.py @@ -1,7 +1,7 @@ # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php -import cgi +import html import six import re from six.moves import html_entities @@ -22,17 +22,17 @@ def html_quote(v, encoding=None): if v is None: return '' elif isinstance(v, six.binary_type): - return cgi.escape(v, 1) + return html.escape(v, 1) elif isinstance(v, six.text_type): if six.PY3: - return cgi.escape(v, 1) + return html.escape(v, 1) else: - return cgi.escape(v.encode(encoding), 1) + return html.escape(v.encode(encoding), 1) else: if six.PY3: - return cgi.escape(six.text_type(v), 1) + return html.escape(six.text_type(v), 1) else: - return cgi.escape(six.text_type(v).encode(encoding), 1) + return html.escape(six.text_type(v).encode(encoding), 1) _unquote_re = re.compile(r'&([a-zA-Z]+);') def _entity_subber(match, name2c=html_entities.name2codepoint): |