changeset 39837:69b4a5b89dc5

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 25 Sep 2018 09:11:56 -0700
parents f1d6021453c2
children bce1c1af7518
files mercurial/wireprotov2server.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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'])