Author: Brian Kearns <[email protected]>
Branch: stdlib-2.7.8
Changeset: r73054:aa5697b998df
Date: 2014-08-25 00:44 -0400
http://bitbucket.org/pypy/pypy/changeset/aa5697b998df/

Log:    update this change to preserve existing behavior

diff --git a/lib-python/2.7/tarfile.py b/lib-python/2.7/tarfile.py
--- a/lib-python/2.7/tarfile.py
+++ b/lib-python/2.7/tarfile.py
@@ -1718,7 +1718,12 @@
         except (ImportError, AttributeError):
             raise CompressionError("gzip module is not available")
 
-        fileobj = gzip.GzipFile(name, mode, compresslevel, fileobj)
+        try:
+            fileobj = gzip.GzipFile(name, mode, compresslevel, fileobj)
+        except OSError:
+            if fileobj is not None and mode == 'r':
+                raise ReadError("not a gzip file")
+            raise
 
         try:
             t = cls.taropen(name, mode, fileobj, **kwargs)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to