Patchwork [8,of,8,py3] py3: iterate bytes as a byte string in store.lowerencode()

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 16, 2017, 2:31 p.m.
Message ID <9003f4dc016c5900d02d.1505572292@mimosa>
Download mbox | patch
Permalink /patch/23943/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 16, 2017, 2:31 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1504427327 -32400
#      Sun Sep 03 17:28:47 2017 +0900
# Node ID 9003f4dc016c5900d02db7a77a0d55d205cffc13
# Parent  60190b90670ddd963881437d5d262348e6002643
py3: iterate bytes as a byte string in store.lowerencode()
Augie Fackler - Sept. 16, 2017, 2:55 p.m.
On Sat, Sep 16, 2017 at 11:31:32PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1504427327 -32400
> #      Sun Sep 03 17:28:47 2017 +0900
> # Node ID 9003f4dc016c5900d02db7a77a0d55d205cffc13
> # Parent  60190b90670ddd963881437d5d262348e6002643
> py3: iterate bytes as a byte string in store.lowerencode()

queued, thanks

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -164,7 +164,7 @@  def _buildlowerencodefun():
     for x in range(ord("A"), ord("Z") + 1):
         cmap[xchr(x)] = xchr(x).lower()
     def lowerencode(s):
-        return "".join([cmap[c] for c in s])
+        return "".join([cmap[c] for c in pycompat.iterbytestr(s)])
     return lowerencode
 
 lowerencode = getattr(parsers, 'lowerencode', None) or _buildlowerencodefun()
diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -63,7 +63,7 @@  testmod('mercurial.parser')
 testmod('mercurial.pycompat')
 testmod('mercurial.revsetlang')
 testmod('mercurial.smartset')
-testmod('mercurial.store', py3=False)  # py3: bytes[n]
+testmod('mercurial.store')
 testmod('mercurial.subrepo')
 testmod('mercurial.templatefilters')
 testmod('mercurial.templater')