D5607: shallowutil: slice off a byte instead of subscripting

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jan 16 16:16:45 UTC 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This behaves identically on Python 2 and 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/shallowutil.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/shallowutil.py b/hgext/remotefilelog/shallowutil.py
--- a/hgext/remotefilelog/shallowutil.py
+++ b/hgext/remotefilelog/shallowutil.py
@@ -121,7 +121,7 @@
     offset = 0
     buflen = len(metabuf)
     while buflen - offset >= 3:
-        key = metabuf[offset]
+        key = metabuf[offset:offset + 1]
         offset += 1
         metalen = struct.unpack_from('!H', metabuf, offset)[0]
         offset += 2



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list