diff mercurial/exchange.py @ 36422:04c319a07c7b

py3: hunt down str(exception) instances and use util.forcebytestr I decided to grep around for \sstr\( and see what low-hanging fruit that showed me. This was part of that hunt. That grep pattern still has some things worth exploring. Differential Revision: https://phab.mercurial-scm.org/D2440
author Augie Fackler <augie@google.com>
date Sun, 25 Feb 2018 23:08:41 -0500
parents 768326377e4d
children 2831d918e1b4
line wrap: on
line diff
--- a/mercurial/exchange.py	Sun Feb 25 22:30:14 2018 -0500
+++ b/mercurial/exchange.py	Sun Feb 25 23:08:41 2018 -0500
@@ -2149,7 +2149,8 @@
                 continue
             except error.UnsupportedBundleSpecification as e:
                 repo.ui.debug('filtering %s because unsupported bundle '
-                              'spec: %s\n' % (entry['URL'], str(e)))
+                              'spec: %s\n' % (
+                                  entry['URL'], util.forcebytestr(e)))
                 continue
         # If we don't have a spec and requested a stream clone, we don't know
         # what the entry is so don't attempt to apply it.
@@ -2254,7 +2255,8 @@
                 bundle2.applybundle(repo, cg, tr, 'clonebundles', url)
             return True
         except urlerr.httperror as e:
-            ui.warn(_('HTTP error fetching bundle: %s\n') % str(e))
+            ui.warn(_('HTTP error fetching bundle: %s\n') %
+                    util.forcebytestr(e))
         except urlerr.urlerror as e:
             ui.warn(_('error fetching bundle: %s\n') % e.reason)