Patchwork D3607: py3: use utils.stringutil.forcebytestr to convert error to bytes

login
register
mail settings
Submitter phabricator
Date May 19, 2018, 7:39 p.m.
Message ID <947ead458f7675d02a1d4257068faaff@localhost.localdomain>
Download mbox | patch
Permalink /patch/31728/
State Not Applicable
Headers show

Comments

phabricator - May 19, 2018, 7:39 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5f2dc1b71cf1: py3: use utils.stringutil.forcebytestr to convert error to bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3607?vs=8778&id=8812

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

AFFECTED FILES
  hgext/infinitepush/__init__.py
  mercurial/fileset.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -354,7 +354,8 @@ 
         # i18n: "grep" is a keyword
         r = re.compile(getstring(x, _("grep requires a pattern")))
     except re.error as e:
-        raise error.ParseError(_('invalid match pattern: %s') % e)
+        raise error.ParseError(_('invalid match pattern: %s') %
+                               stringutil.forcebytestr(e))
     return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())]
 
 def _sizetomax(s):
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -576,7 +576,7 @@ 
                 if repo.bundlestore.index.getbundle(localkey):
                     return "%d %s\n" % (1, localkey)
                 else:
-                    r = str(inst)
+                    r = stringutil.forcebytestr(inst)
                     return "%d %s\n" % (0, r)
     return _lookup