Patchwork D2421: py3: use util.forcebytestr to convert error messages to bytes

login
register
mail settings
Submitter phabricator
Date Feb. 24, 2018, 12:57 p.m.
Message ID <2730f7833894ccbb0ea430a4f1621533@localhost.localdomain>
Download mbox | patch
Permalink /patch/28324/
State Not Applicable
Headers show

Comments

phabricator - Feb. 24, 2018, 12:57 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG743b293c3ca0: py3: use util.forcebytestr to convert error messages to bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2421?vs=6045&id=6051

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

AFFECTED FILES
  mercurial/branchmap.py
  mercurial/tags.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/tags.py b/mercurial/tags.py
--- a/mercurial/tags.py
+++ b/mercurial/tags.py
@@ -783,6 +783,6 @@ 
         except (IOError, OSError) as inst:
             repo.ui.log('tagscache',
                         "couldn't write cache/%s: %s\n" % (
-                        _fnodescachefile, inst))
+                        _fnodescachefile, util.forcebytestr(inst)))
         finally:
             lock.release()
diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -255,7 +255,8 @@ 
                         repo.filtername, len(self), nodecount)
         except (IOError, OSError, error.Abort) as inst:
             # Abort may be raised by read only opener, so log and continue
-            repo.ui.debug("couldn't write branch cache: %s\n" % inst)
+            repo.ui.debug("couldn't write branch cache: %s\n" %
+                          util.forcebytestr(inst))
 
     def update(self, repo, revgen):
         """Given a branchhead cache, self, that may have extra nodes or be