# HG changeset patch # User Gregory Szorc # Date 2018-09-25 16:11:56 # Node ID 69b4a5b89dc546db2b19bb452fdf1967ff98e7c5 # Parent f1d6021453c2c495f0a0e53711913181cdcecc3c py3: cast exception to bytes This was raising a TypeError on Python 3 and preventing most (all?) wireprotov2 commands from working. Differential Revision: https://phab.mercurial-scm.org/D4731 diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -29,6 +29,7 @@ from . import ( ) from .utils import ( interfaceutil, + stringutil, ) FRAMINGTYPE = b'application/mercurial-exp-framing-0005' @@ -319,7 +320,8 @@ def _httpv2runcommand(ui, repo, req, res except Exception as e: action, meta = reactor.onservererror( outstream, command['requestid'], - _('exception when invoking command: %s') % e) + _('exception when invoking command: %s') % + stringutil.forcebytestr(e)) if action == 'sendframes': res.setbodygen(meta['framegen'])