Patchwork [2,of,2] py3: use pycompat.bytestr so that we don't get ascii values

login
register
mail settings
Submitter Pulkit Goyal
Date May 29, 2017, 11:15 a.m.
Message ID <611f4a01f5cf69ccf15b.1496056512@workspace>
Download mbox | patch
Permalink /patch/21031/
State Accepted
Headers show

Comments

Pulkit Goyal - May 29, 2017, 11:15 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1496055075 -19800
#      Mon May 29 16:21:15 2017 +0530
# Node ID 611f4a01f5cf69ccf15bd434775556bafc4ab41c
# Parent  f444b13443de1af28222524d9209640cce17686e
py3: use pycompat.bytestr so that we don't get ascii values

This fixes `hg files 'set:(**.py)'` which makes test-check-py3-compat.t able to
run on Python 3. So if you now do `python3 ./run-tests.py
test-check-py3-compat`, the test will actually run.
Yuya Nishihara - May 29, 2017, 12:44 p.m.
On Mon, 29 May 2017 16:45:12 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1496055075 -19800
> #      Mon May 29 16:21:15 2017 +0530
> # Node ID 611f4a01f5cf69ccf15bd434775556bafc4ab41c
> # Parent  f444b13443de1af28222524d9209640cce17686e
> py3: use pycompat.bytestr so that we don't get ascii values

Queued these, thanks.

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -14,6 +14,7 @@ 
     error,
     merge,
     parser,
+    pycompat,
     registrar,
     scmutil,
     util,
@@ -43,6 +44,7 @@ 
 
 def tokenize(program):
     pos, l = 0, len(program)
+    program = pycompat.bytestr(program)
     while pos < l:
         c = program[pos]
         if c.isspace(): # skip inter-token whitespace