Commit c5e1199f authored by Lars Gustäbel's avatar Lars Gustäbel

Issue #5689: Avoid excessive memory usage by using the default lzma preset.

parent 50a4d5de
...@@ -1807,7 +1807,7 @@ class TarFile(object): ...@@ -1807,7 +1807,7 @@ class TarFile(object):
return t return t
@classmethod @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. """Open lzma compressed tar archive name for reading or writing.
Appending is not allowed. Appending is not allowed.
""" """
...@@ -1819,10 +1819,6 @@ class TarFile(object): ...@@ -1819,10 +1819,6 @@ class TarFile(object):
except ImportError: except ImportError:
raise CompressionError("lzma module is not available") 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, fileobj = lzma.LZMAFile(filename=name if fileobj is None else None,
mode=mode, fileobj=fileobj, preset=preset) mode=mode, fileobj=fileobj, preset=preset)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment