# HG changeset patch # User Augie Fackler # Date 2018-02-26 05:49:33 # Node ID f8ea6988a5fbf468c75753bf2d42adeeb3c7fc1a # Parent 0b697c650b0495e73650e1dbe063c235e5fa74ef 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 diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -93,7 +93,7 @@ class ErrorResponse(Exception): 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 = []