# HG changeset patch # User Yuya Nishihara # Date 2017-03-26 08:12:06 # Node ID 6ceb3c4c3ab6e4caf68c3ba0909878896af0faac # Parent addc392cc3d347749125775e078c9279a032b873 py3: fix slicing of byte string in revlog.compress() I tried .startswith('\0'), but data wasn't always a bytes nor a bytearray. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1488,7 +1488,7 @@ class revlog(object): # The revlog compressor added the header in the returned data. return '', compressed - if data[0] == '\0': + if data[0:1] == '\0': return '', data return 'u', data