Mercurial > public > mercurial-scm > hg-stable
diff mercurial/wireprotov2server.py @ 39842: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 | 3ed53b071041 |
children | 7b752bf08435 |
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'])