# HG changeset patch # User Denis Laxalde # Date 1576006556 -3600 # Node ID a9457b9aca4eb341ea23ed682bbdf12b39c9b25c # Parent 88b816a9d990548b3cad7c990d213d0f432eba31 py3: fix several TypeError formatting bytes with an exception object diff -r 88b816a9d990 -r a9457b9aca4e hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Fri Oct 11 21:32:27 2019 +0200 +++ b/hgext3rd/evolve/obsdiscovery.py Tue Dec 10 20:35:56 2019 +0100 @@ -33,6 +33,7 @@ util, ) from mercurial.i18n import _ +from mercurial.utils import stringutil from . import ( compat, @@ -447,7 +448,9 @@ for r in ranges: self._data.pop(r, None) except (sqlite3.DatabaseError, sqlite3.OperationalError) as exc: - repo.ui.log(b'evoext-cache', b'error while updating obshashrange cache: %s' % exc) + repo.ui.log(b'evoext-cache', + b'error while updating obshashrange cache: %s' + % stringutil.forcebytestr(exc)) del self._updating return @@ -551,8 +554,11 @@ if r'_con' in vars(self): del self._con self._new.clear() - repo.ui.log(b'evoext-cache', b'error while saving new data: %s' % exc) - repo.ui.debug(b'evoext-cache: error while saving new data: %s' % exc) + repo.ui.log(b'evoext-cache', + b'error while saving new data: %s' + % stringutil.forcebytestr(exc)) + repo.ui.debug(b'evoext-cache: error while saving new data: %s' + % stringutil.forcebytestr(exc)) def _trysave(self, repo): if self._con is None: