Patchwork [4,of,6] bundle2: portably grab first byte of part name for letter check

login
register
mail settings
Submitter Augie Fackler
Date Sept. 19, 2017, 4:08 p.m.
Message ID <8def3a241d2298eb47be.1505837307@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/24020/
State Accepted
Headers show

Comments

Augie Fackler - Sept. 19, 2017, 4:08 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1505795275 14400
#      Tue Sep 19 00:27:55 2017 -0400
# Node ID 8def3a241d2298eb47bebb19f70ec8d4c1341739
# Parent  b4cb774af1c9da914c81e8bf42988828f9807b61
bundle2: portably grab first byte of part name for letter check

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -615,7 +615,7 @@  class bundle20(object):
         """add a stream level parameter"""
         if not name:
             raise ValueError(r'empty parameter name')
-        if name[0] not in pycompat.bytestr(string.ascii_letters):
+        if name[0:1] not in pycompat.bytestr(string.ascii_letters):
             raise ValueError(r'non letter first character: %s' % name)
         self._params.append((name, value))