element access on bytes yields int in py3k
authorHelmut Grohne <helmut@subdivi.de>
Thu, 16 Apr 2015 15:47:20 +0000 (17:47 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Thu, 16 Apr 2015 15:47:20 +0000 (17:47 +0200)
dedup/compression.py

index cc65bbf..4fd7320 100644 (file)
@@ -35,7 +35,7 @@ class GzipDecompressor(object):
                 return b""
             if not self.inbuffer.startswith(b"\037\213\010"):
                 raise ValueError("gzip magic not found")
                 return b""
             if not self.inbuffer.startswith(b"\037\213\010"):
                 raise ValueError("gzip magic not found")
-            flag = ord(self.inbuffer[3])
+            flag = ord(self.inbuffer[3:4])
             if flag & 4:
                 if len(self.inbuffer) < skip + 2:
                     return b""
             if flag & 4:
                 if len(self.inbuffer) < skip + 2:
                     return b""