Patchwork D7466: patch: fix a str + bytes issue in an exception handler

login
register
mail settings
Submitter phabricator
Date Nov. 21, 2019, 11:23 p.m.
Message ID <differential-rev-PHID-DREV-z2hudeuuqpx3bbmz5uro-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43395/
State Superseded
Headers show

Comments

phabricator - Nov. 21, 2019, 11:23 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Flagged by pytype.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7466

AFFECTED FILES
  mercurial/patch.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 22, 2019, 2:47 a.m.
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  I'll put this one on stable.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7466/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7466

To: mharbison72, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2290,7 +2290,7 @@ 
             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