Patchwork D3284: py3: use stringutil.forcebytestr() to convert error messages to bytes

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 12:07 p.m.
Message ID <differential-rev-PHID-DREV-an7wosqfhdlifc3kptiu-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30783/
State Superseded
Headers show

Comments

phabricator - April 12, 2018, 12:07 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/subrepoutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/subrepoutil.py b/mercurial/subrepoutil.py
--- a/mercurial/subrepoutil.py
+++ b/mercurial/subrepoutil.py
@@ -86,7 +86,8 @@ 
                 src = re.sub(pattern, repl, src, 1)
             except re.error as e:
                 raise error.Abort(_("bad subrepository pattern in %s: %s")
-                                 % (p.source('subpaths', pattern), e))
+                                 % (p.source('subpaths', pattern),
+                                    stringutil.forcebytestr(e)))
         return src
 
     state = {}