diff options
author | Gustavo Picon <tabo@tabo.pe> | 2014-01-11 16:13:54 -0500 |
---|---|---|
committer | Gustavo Picon <tabo@tabo.pe> | 2014-01-11 16:13:54 -0500 |
commit | 68d3fc623d65695ea3261440997b242f2ebc6e7b (patch) | |
tree | b3b6e49c8ef096b46a9afb9bb61b356b11b48142 /cherrypy/lib/encoding.py | |
parent | b21c49862777140abe49fc819feabe5904122364 (diff) | |
download | cherrypy-git-68d3fc623d65695ea3261440997b242f2ebc6e7b.tar.gz |
Return sorted charsets in the encoding error message.
Determinism fixes a broken test in python3
Diffstat (limited to 'cherrypy/lib/encoding.py')
-rw-r--r-- | cherrypy/lib/encoding.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cherrypy/lib/encoding.py b/cherrypy/lib/encoding.py index 31a6d3ab..02a50f87 100644 --- a/cherrypy/lib/encoding.py +++ b/cherrypy/lib/encoding.py @@ -178,7 +178,8 @@ class ResponseEncoder: msg = "Your client did not send an Accept-Charset header." else: msg = "Your client sent this Accept-Charset header: %s." % ac - msg += " We tried these charsets: %s." % ", ".join(self.attempted_charsets) + _charsets = ", ".join(sorted(self.attempted_charsets)) + msg += " We tried these charsets: %s." % (_charsets,) raise cherrypy.HTTPError(406, msg) def __call__(self, *args, **kwargs): |