Patchwork D2516: py3: use pycompat.bytestr() to convert error instances to bytes

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 7:16 p.m.
Message ID <0bd666caff71772392c7e6bd5a63cdec@localhost.localdomain>
Download mbox | patch
Permalink /patch/28584/
State Not Applicable
Headers show

Comments

phabricator - March 1, 2018, 7:16 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6e90c59b6da1: py3: use pycompat.bytestr() to convert error instances to bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2516?vs=6262&id=6271

REVISION DETAIL
  https://phab.mercurial-scm.org/D2516

AFFECTED FILES
  mercurial/commands.py
  mercurial/debugcommands.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1591,7 +1591,8 @@ 
                                      metadata=metadata, ui=ui)
                 tr.close()
             except ValueError as exc:
-                raise error.Abort(_('bad obsmarker input: %s') % exc)
+                raise error.Abort(_('bad obsmarker input: %s') %
+                                  pycompat.bytestr(exc))
             finally:
                 tr.release()
         finally:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2370,7 +2370,7 @@ 
     try:
         regexp = util.re.compile(pattern, reflags)
     except re.error as inst:
-        ui.warn(_("grep: invalid match pattern: %s\n") % inst)
+        ui.warn(_("grep: invalid match pattern: %s\n") % pycompat.bytestr(inst))
         return 1
     sep, eol = ':', '\n'
     if opts.get('print0'):