D2447: hgweb: pass exception message to builtin Exception ctor as sysstr

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Feb 26 06:02:14 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  If we don't do this, the bytes gets repr()ed on Python 3 and we get
  bogus error strings sent to clients. Ick.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2447

AFFECTED FILES
  mercurial/hgweb/common.py

CHANGE DETAILS

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 @@
     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 = []



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list