summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2011-12-06 11:56:38 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2011-12-06 11:56:38 (GMT)
commited1ac587df34dc30ddd49549d3286befb059dd31 (patch)
tree6bda0a239f420a78f725f4d6e1babaf00de12836 /Lib/tarfile.py
parent9f5713546503628d4af0895eb76f1368160853be (diff)
downloadcpython-ed1ac587df34dc30ddd49549d3286befb059dd31.zip
cpython-ed1ac587df34dc30ddd49549d3286befb059dd31.tar.gz
cpython-ed1ac587df34dc30ddd49549d3286befb059dd31.tar.bz2
Correctly detect bzip2 compressed streams with blocksizes other than 900k.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index d8d94f0..226d481 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -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"