py3: use util.forcebytestr to convert error messages to bytes
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 24 Feb 2018 16:20:15 +0530
changeset 36396 743b293c3ca0
parent 36395 fb7897e53d49
child 36397 7a3590e67868
py3: use util.forcebytestr to convert error messages to bytes Differential Revision: https://phab.mercurial-scm.org/D2421
mercurial/branchmap.py
mercurial/tags.py
--- a/mercurial/branchmap.py	Sat Feb 24 16:15:16 2018 +0530
+++ b/mercurial/branchmap.py	Sat Feb 24 16:20:15 2018 +0530
@@ -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
--- a/mercurial/tags.py	Sat Feb 24 16:15:16 2018 +0530
+++ b/mercurial/tags.py	Sat Feb 24 16:20:15 2018 +0530
@@ -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()