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

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 1:45 a.m.
Message ID <44e546f48a01b106455c41a15308f577@localhost.localdomain>
Download mbox | patch
Permalink /patch/28033/
State Not Applicable
Headers show

Comments

phabricator - Feb. 18, 2018, 1:45 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2b00dda6dad9: scmutil: bytes-ify IOErrors before wrapping them in abort message (authored by durin42, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D2292?vs=5813&id=5815#toc

REPOSITORY
  rHG Mercurial

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

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") % util.forcebytestr(inst))
         elif util.safehasattr(inst, "reason"):
             try: # usually it is in the form (errno, strerror)
                 reason = inst.reason.args[1]