# HG changeset patch # User Yuya Nishihara # Date 1518611367 -32400 # Node ID 46260fac556348f3600bae2d41af058f131a3460 # Parent deb851914fd7b89ac994750c415dd64efc9f8b69 py3: stringify IOError/OSError without loosing local character Follows up fa4d333cac58. An environment error may contain non-ascii characters on Windows, which should be encoded to a platform-native string. diff -r deb851914fd7 -r 46260fac5563 mercurial/branchmap.py --- a/mercurial/branchmap.py Fri Jan 26 19:48:39 2018 +0900 +++ b/mercurial/branchmap.py Wed Feb 14 21:29:27 2018 +0900 @@ -377,7 +377,7 @@ self._rbcrevs[:] = data except (IOError, OSError) as inst: repo.ui.debug("couldn't read revision branch cache: %s\n" % - pycompat.bytestr(inst)) + util.forcebytestr(inst)) # remember number of good records on disk self._rbcrevslen = min(len(self._rbcrevs) // _rbcrecsize, len(repo.changelog))