commit | 9a38863d8ce5444be29d2e20341b28147b94f33a | [log] [tgz] |
---|---|---|
author | Lars Gustäbel <lars@gustaebel.de> | Tue Dec 06 13:07:09 2011 +0100 |
committer | Lars Gustäbel <lars@gustaebel.de> | Tue Dec 06 13:07:09 2011 +0100 |
tree | bc8d512e0e17b5b3488a20ccd3bc781e622285aa | |
parent | 22da68b1b034beac7867058f37a2fc9924f247f3 [diff] [blame] |
Correctly detect bzip2 compressed streams with blocksizes other than 900k.
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 6828eab..ed5bcf2 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py
@@ -627,7 +627,7 @@ def getcomptype(self): if self.buf.startswith("\037\213\010"): return "gz" - if self.buf.startswith("BZh91"): + if self.buf[0:3] == "BZh" and self.buf[4:10] == "1AY&SY": return "bz2" return "tar"