Correctly detect bzip2 compressed streams with blocksizes other than 900k.

This commit is contained in:
Lars Gustäbel 2011-12-06 12:56:38 +01:00
parent 9f57135465
commit ed1ac587df
3 changed files with 22 additions and 5 deletions

View file

@ -627,7 +627,7 @@ class _StreamProxy(object):
def getcomptype(self):
if self.buf.startswith(b"\037\213\010"):
return "gz"
if self.buf.startswith(b"BZh91"):
if self.buf[0:3] == b"BZh" and self.buf[4:10] == b"1AY&SY":
return "bz2"
return "tar"