Patchwork D3368: stringutil: ast.literal_eval needs a unicode on py3

login
register
mail settings
Submitter phabricator
Date April 14, 2018, 12:14 p.m.
Message ID <ba696b9a44c58d131cf3dcefdd515035@localhost.localdomain>
Download mbox | patch
Permalink /patch/31016/
State Not Applicable
Headers show

Comments

phabricator - April 14, 2018, 12:14 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3942bd8db8b2: stringutil: ast.literal_eval needs a unicode on py3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3368?vs=8245&id=8264

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

AFFECTED FILES
  contrib/python3-whitelist
  mercurial/utils/stringutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py
--- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -510,4 +510,6 @@ 
 def evalpythonliteral(s):
     """Evaluate a string containing a Python literal expression"""
     # We could backport our tokenizer hack to rewrite '' to u'' if we want
+    if pycompat.ispy3:
+        return ast.literal_eval(s.decode('latin1'))
     return ast.literal_eval(s)
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -437,4 +437,5 @@ 
 test-verify.t
 test-websub.t
 test-win32text.t
+test-wireproto-framing.py
 test-xdg.t