[pypy-svn] pypy fast-forward: Don't open the .tgz file in TarFile: GzipFile will do it if needed,
amauryfa
commits-noreply at bitbucket.org
Wed Jan 12 01:23:25 CET 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: fast-forward
Changeset: r40612:5f5ec504ba09
Date: 2011-01-12 00:46 +0100
http://bitbucket.org/pypy/pypy/changeset/5f5ec504ba09/
Log: Don't open the .tgz file in TarFile: GzipFile will do it if needed,
and will take the responsibility to close() the file correctly
diff --git a/lib-python/modified-2.7.0/tarfile.py b/lib-python/modified-2.7.0/tarfile.py
--- a/lib-python/modified-2.7.0/tarfile.py
+++ b/lib-python/modified-2.7.0/tarfile.py
@@ -1716,9 +1716,6 @@
except (ImportError, AttributeError):
raise CompressionError("gzip module is not available")
- if fileobj is None:
- fileobj = bltn_open(name, mode + "b")
-
try:
t = cls.taropen(name, mode,
gzip.GzipFile(name, mode, compresslevel, fileobj),
More information about the Pypy-commit
mailing list