diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py --- a/mercurial/wireprotoframing.py +++ b/mercurial/wireprotoframing.py @@ -21,6 +21,7 @@ from . import ( encoding, error, + pycompat, util, ) from .utils import ( @@ -827,9 +828,10 @@ break except Exception as e: - for frame in createerrorframe(stream, requestid, - '%s' % e, - errtype='server'): + for frame in createerrorframe( + stream, requestid, '%s' % stringutil.forcebytestr(e), + errtype='server'): + yield frame break