-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Description
Bug report
Bug description:
I found the bug when I was browsing the source code, so I just put the source code here:
@classmethod
def open(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs):
# irrevalent code...
elif "|" in mode:
# irrevalent code...
compresslevel = kwargs.pop("compresslevel", 6)
preset = kwargs.pop("preset", None)
stream = _Stream(name, filemode, comptype, fileobj, bufsize,
compresslevel, preset)
# irrevalent code...
But the doc says that:
For modes 'w:zst', 'x:zst' and 'w|zst', tarfile.open() accepts the keyword argument level to specify the compression level of the file. The keyword argument options may also be passed, providing advanced Zstandard compression parameters described by CompressionParameter. The keyword argument zstd_dict can be passed to provide a ZstdDict, a Zstandard dictionary used to improve compression of smaller amounts of data.
So there're three keyword arguments: level
, options
and zstd_dict
that need to pass to _Stream
constructor, and the constructor needs to change to accept these keyword arguments.
I'll open a PR to fix this soon.
CPython versions tested on:
3.14
Operating systems tested on:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status