[PATCH 1 of 3] py3: fix asciistr table in store.py
Yuya Nishihara
yuya at tcha.org
Wed Mar 8 15:52:48 UTC 2017
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1488979554 -32400
# Wed Mar 08 22:25:54 2017 +0900
# Node ID 9fc739fcfb59421146294285d450eff80f8dc587
# Parent 08b1e247765641ab9ab7734add717e0c64b3c938
py3: fix asciistr table in store.py
bytes(n) creates an n-length bytes of zeros on Python 3.
diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -101,7 +101,7 @@ def _buildencodefun():
e = '_'
if pycompat.ispy3:
xchr = lambda x: bytes([x])
- asciistr = [bytes(a) for a in range(127)]
+ asciistr = [xchr(a) for a in range(127)]
else:
xchr = chr
asciistr = map(chr, xrange(127))
More information about the Mercurial-devel
mailing list