[Python-checkins] cpython: Issue #5689: Avoid excessive memory usage by using the default lzma preset.

lars.gustaebel python-checkins at python.org
Wed Jan 18 14:04:27 CET 2012


http://hg.python.org/cpython/rev/b86b54fcb5c2
changeset:   74495:b86b54fcb5c2
user:        Lars Gustäbel <lars at gustaebel.de>
date:        Wed Jan 18 14:01:17 2012 +0100
summary:
  Issue #5689: Avoid excessive memory usage by using the default lzma preset.

files:
  Lib/tarfile.py |  6 +-----
  1 files changed, 1 insertions(+), 5 deletions(-)


diff --git a/Lib/tarfile.py b/Lib/tarfile.py
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1807,7 +1807,7 @@
         return t
 
     @classmethod
-    def xzopen(cls, name, mode="r", fileobj=None, preset=9, **kwargs):
+    def xzopen(cls, name, mode="r", fileobj=None, preset=None, **kwargs):
         """Open lzma compressed tar archive name for reading or writing.
            Appending is not allowed.
         """
@@ -1819,10 +1819,6 @@
         except ImportError:
             raise CompressionError("lzma module is not available")
 
-        if mode == "r":
-            # LZMAFile complains about a preset argument in read mode.
-            preset = None
-
         fileobj = lzma.LZMAFile(filename=name if fileobj is None else None,
                 mode=mode, fileobj=fileobj, preset=preset)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list