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
--- a/mercurial/wireprotov2server.py Tue Sep 25 23:25:36 2018 -0400
+++ b/mercurial/wireprotov2server.py Tue Sep 25 09:11:56 2018 -0700
@@ -29,6 +29,7 @@
)
from .utils import (
interfaceutil,
+ stringutil,
)
FRAMINGTYPE = b'application/mercurial-exp-framing-0005'
@@ -319,7 +320,8 @@
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'])