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

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2018, 8:22 a.m.
Message ID <differential-rev-PHID-DREV-jegxco57tjanovi2tewh-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27299/
State Superseded
Headers show

Comments

phabricator - Feb. 5, 2018, 8:22 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
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():