D4731: py3: cast exception to bytes

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Tue Sep 25 03:32:14 UTC 2018


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

REVISION SUMMARY
  This was raising a TypeError on Python 3 and preventing most (all?)
  wireprotov2 commands from working.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/wireprotov2server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -319,7 +319,8 @@
     except Exception as e:
         action, meta = reactor.onservererror(
             outstream, command['requestid'],
-            _('exception when invoking command: %s') % e)
+            _('exception when invoking command: %s') %
+            pycompat.sysbytes(str(e)))
 
     if action == 'sendframes':
         res.setbodygen(meta['framegen'])



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


More information about the Mercurial-devel mailing list