Patchwork D2039: py3: slice on bytes to prevent getting the ascii values

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2018, 2:27 p.m.
Message ID <cea7468f686bd069fc6c1e2c242270c9@localhost.localdomain>
Download mbox | patch
Permalink /patch/27316/
State Not Applicable
Headers show

Comments

phabricator - Feb. 5, 2018, 2:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG558e01a23f40: py3: slice on bytes to prevent getting the ascii values (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2039?vs=5197&id=5210

REVISION DETAIL
  https://phab.mercurial-scm.org/D2039

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1196,7 +1196,7 @@ 
             if k == self.firstlinekey:
                 e = "key name '%s' is reserved" % self.firstlinekey
                 raise error.ProgrammingError(e)
-            if not k[0].isalpha():
+            if not k[0:1].isalpha():
                 e = "keys must start with a letter in a key-value file"
                 raise error.ProgrammingError(e)
             if not k.isalnum():