diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2012-01-18 13:01:17 (GMT) |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2012-01-18 13:01:17 (GMT) |
commit | c5e1199f3865a2671e3ce16c6265aa869466356b (patch) | |
tree | 3f7a9ce8ec68bab482579bf2da9f3d1a975ee309 /Lib/tarfile.py | |
parent | 50a4d5debb952bb319d8a8141e47a39c3fb03250 (diff) | |
download | cpython-c5e1199f3865a2671e3ce16c6265aa869466356b.zip cpython-c5e1199f3865a2671e3ce16c6265aa869466356b.tar.gz cpython-c5e1199f3865a2671e3ce16c6265aa869466356b.tar.bz2 |
Issue #5689: Avoid excessive memory usage by using the default lzma preset.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 5c9d3a8..e3380a2 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1807,7 +1807,7 @@ class TarFile(object): 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 @@ class TarFile(object): 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) |