# HG changeset patch # User Matt Harbison # Date 2019-11-21 19:28:28 # Node ID eab0b7383cd3ba388cdbd9dd8a617f0c288e8731 # Parent aff3f6e407a118393caaf892d1027e5cb753c956 patch: fix a str + bytes issue in an exception handler Flagged by pytype. Differential Revision: https://phab.mercurial-scm.org/D7466 diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2290,7 +2290,7 @@ def _applydiff( try: current_file = patcher(ui, gp, backend, store, eolmode=eolmode) except PatchError as inst: - ui.warn(str(inst) + b'\n') + ui.warn(stringutil.forcebytestr(inst) + b'\n') current_file = None rejects += 1 continue