##// END OF EJS Templates
py3: hunt down str(exception) instances and use util.forcebytestr...
Augie Fackler -
r36440:04c319a0 default
parent child Browse files
Show More
@@ -3899,7 +3899,7 b' def postincoming(ui, repo, modheads, opt'
3899 try:
3899 try:
3900 return hg.updatetotally(ui, repo, checkout, brev)
3900 return hg.updatetotally(ui, repo, checkout, brev)
3901 except error.UpdateAbort as inst:
3901 except error.UpdateAbort as inst:
3902 msg = _("not updating: %s") % str(inst)
3902 msg = _("not updating: %s") % util.forcebytestr(inst)
3903 hint = inst.hint
3903 hint = inst.hint
3904 raise error.UpdateAbort(msg, hint=hint)
3904 raise error.UpdateAbort(msg, hint=hint)
3905 if modheads > 1:
3905 if modheads > 1:
@@ -2149,7 +2149,8 b' def filterclonebundleentries(repo, entri'
2149 continue
2149 continue
2150 except error.UnsupportedBundleSpecification as e:
2150 except error.UnsupportedBundleSpecification as e:
2151 repo.ui.debug('filtering %s because unsupported bundle '
2151 repo.ui.debug('filtering %s because unsupported bundle '
2152 'spec: %s\n' % (entry['URL'], str(e)))
2152 'spec: %s\n' % (
2153 entry['URL'], util.forcebytestr(e)))
2153 continue
2154 continue
2154 # If we don't have a spec and requested a stream clone, we don't know
2155 # If we don't have a spec and requested a stream clone, we don't know
2155 # what the entry is so don't attempt to apply it.
2156 # what the entry is so don't attempt to apply it.
@@ -2254,7 +2255,8 b' def trypullbundlefromurl(ui, repo, url):'
2254 bundle2.applybundle(repo, cg, tr, 'clonebundles', url)
2255 bundle2.applybundle(repo, cg, tr, 'clonebundles', url)
2255 return True
2256 return True
2256 except urlerr.httperror as e:
2257 except urlerr.httperror as e:
2257 ui.warn(_('HTTP error fetching bundle: %s\n') % str(e))
2258 ui.warn(_('HTTP error fetching bundle: %s\n') %
2259 util.forcebytestr(e))
2258 except urlerr.urlerror as e:
2260 except urlerr.urlerror as e:
2259 ui.warn(_('error fetching bundle: %s\n') % e.reason)
2261 ui.warn(_('error fetching bundle: %s\n') % e.reason)
2260
2262
@@ -259,7 +259,8 b' class localpeer(repository.peer):'
259 bundle2.processbundle(self._repo, b)
259 bundle2.processbundle(self._repo, b)
260 raise
260 raise
261 except error.PushRaced as exc:
261 except error.PushRaced as exc:
262 raise error.ResponseError(_('push failed:'), str(exc))
262 raise error.ResponseError(_('push failed:'),
263 util.forcebytestr(exc))
263
264
264 # End of _basewirecommands interface.
265 # End of _basewirecommands interface.
265
266
@@ -208,7 +208,7 b' def callcatch(ui, func):'
208 ui.warn(_("(%s)\n") % inst.hint)
208 ui.warn(_("(%s)\n") % inst.hint)
209 except ImportError as inst:
209 except ImportError as inst:
210 ui.warn(_("abort: %s!\n") % inst)
210 ui.warn(_("abort: %s!\n") % inst)
211 m = str(inst).split()[-1]
211 m = util.forcebytestr(inst).split()[-1]
212 if m in "mpatch bdiff".split():
212 if m in "mpatch bdiff".split():
213 ui.warn(_("(did you forget to compile extensions?)\n"))
213 ui.warn(_("(did you forget to compile extensions?)\n"))
214 elif m in "zlib".split():
214 elif m in "zlib".split():
@@ -366,7 +366,7 b' class ui(object):'
366 except error.ConfigError as inst:
366 except error.ConfigError as inst:
367 if trusted:
367 if trusted:
368 raise
368 raise
369 self.warn(_("ignored: %s\n") % str(inst))
369 self.warn(_("ignored: %s\n") % util.forcebytestr(inst))
370
370
371 if self.plain():
371 if self.plain():
372 for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
372 for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
@@ -449,7 +449,7 b' class cookiehandler(urlreq.basehandler):'
449 self.cookiejar = cookiejar
449 self.cookiejar = cookiejar
450 except util.cookielib.LoadError as e:
450 except util.cookielib.LoadError as e:
451 ui.warn(_('(error loading cookie file %s: %s; continuing without '
451 ui.warn(_('(error loading cookie file %s: %s; continuing without '
452 'cookies)\n') % (cookiefile, str(e)))
452 'cookies)\n') % (cookiefile, util.forcebytestr(e)))
453
453
454 def http_request(self, request):
454 def http_request(self, request):
455 if self.cookiejar:
455 if self.cookiejar:
@@ -3634,7 +3634,7 b' class _zlibengine(compressionengine):'
3634 return zlib.decompress(data)
3634 return zlib.decompress(data)
3635 except zlib.error as e:
3635 except zlib.error as e:
3636 raise error.RevlogError(_('revlog decompress error: %s') %
3636 raise error.RevlogError(_('revlog decompress error: %s') %
3637 str(e))
3637 forcebytestr(e))
3638
3638
3639 def revlogcompressor(self, opts=None):
3639 def revlogcompressor(self, opts=None):
3640 return self.zlibrevlogcompressor()
3640 return self.zlibrevlogcompressor()
@@ -3860,7 +3860,7 b' class _zstdengine(compressionengine):'
3860 return ''.join(chunks)
3860 return ''.join(chunks)
3861 except Exception as e:
3861 except Exception as e:
3862 raise error.RevlogError(_('revlog decompress error: %s') %
3862 raise error.RevlogError(_('revlog decompress error: %s') %
3863 str(e))
3863 forcebytestr(e))
3864
3864
3865 def revlogcompressor(self, opts=None):
3865 def revlogcompressor(self, opts=None):
3866 opts = opts or {}
3866 opts = opts or {}
General Comments 0
You need to be logged in to leave comments. Login now