diff --git a/mercurial/archival.py b/mercurial/archival.py --- a/mercurial/archival.py +++ b/mercurial/archival.py @@ -154,7 +154,7 @@ class tarit(object): 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', diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2518,7 +2518,7 @@ def difflabel(func, *args, **kw): 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)