diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py --- a/mercurial/wireprotoframing.py +++ b/mercurial/wireprotoframing.py @@ -827,9 +827,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