py3: slice over bytes or use .startswith() to prevent getting ascii values
Differential Revision: https://phab.mercurial-scm.org/D2457
--- a/mercurial/archival.py Mon Feb 26 16:23:12 2018 +0530
+++ b/mercurial/archival.py Mon Feb 26 17:25:46 2018 +0530
@@ -154,7 +154,7 @@
def taropen(mode, name='', fileobj=None):
if kind == 'gz':
- mode = mode[0]
+ mode = mode[0:1]
if not fileobj:
fileobj = open(name, mode + 'b')
gzfileobj = self.GzipFileWithTime(name, mode + 'b',
--- a/mercurial/patch.py Mon Feb 26 16:23:12 2018 +0530
+++ b/mercurial/patch.py Mon Feb 26 17:25:46 2018 +0530
@@ -2518,7 +2518,7 @@
yield (t, l)
else:
for token in tabsplitter.findall(stripline):
- if '\t' == token[0]:
+ if token.startswith('\t'):
yield (token, 'diff.tab')
else:
yield (token, label)