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

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 6:02 a.m.
Message ID <differential-rev-PHID-DREV-z4cxzhqsr57buyhx5r5p-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28377/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2018, 6:02 a.m.
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




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

Patch

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