changeset 36429:f8ea6988a5fb

hgweb: pass exception message to builtin Exception ctor as sysstr If we don't do this, the bytes gets repr()ed on Python 3 and we get bogus error strings sent to clients. Ick. Differential Revision: https://phab.mercurial-scm.org/D2447
author Augie Fackler <augie@google.com>
date Mon, 26 Feb 2018 00:49:33 -0500
parents 0b697c650b04
children efebfa9b4cab
files mercurial/hgweb/common.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Mon Feb 26 00:28:10 2018 -0500
+++ b/mercurial/hgweb/common.py	Mon Feb 26 00:49:33 2018 -0500
@@ -93,7 +93,7 @@
     def __init__(self, code, message=None, headers=None):
         if message is None:
             message = _statusmessage(code)
-        Exception.__init__(self, message)
+        Exception.__init__(self, pycompat.sysstr(message))
         self.code = code
         if headers is None:
             headers = []