Patchwork D2292: scmutil: bytes-ify IOErrors before wrapping them in abort message

login
register
mail settings
Submitter phabricator
Date Feb. 17, 2018, 9:17 p.m.
Message ID <cafe47f43668e9641ba2e90859f35f50@localhost.localdomain>
Download mbox | patch
Permalink /patch/28031/
State Not Applicable
Headers show

Comments

phabricator - Feb. 17, 2018, 9:17 p.m.
durin42 updated this revision to Diff 5813.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2292?vs=5797&id=5813

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, yuja
Cc: pulkit, mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -215,7 +215,7 @@ 
             ui.warn(_("(is your Python install correct?)\n"))
     except IOError as inst:
         if util.safehasattr(inst, "code"):
-            ui.warn(_("abort: %s\n") % inst)
+            ui.warn(_("abort: %s\n") % pycompat.forcebytestr(inst))
         elif util.safehasattr(inst, "reason"):
             try: # usually it is in the form (errno, strerror)
                 reason = inst.reason.args[1]