Skip to content

Zstandard in the standard library (PEP 784) #5

@Rogdham

Description

@Rogdham

As you may know, Python 3.14 introduces the compression.zstd module, which adds native Zstandard support to the standard library (PEP 784). It also adds support for Zstandard in the zipfile module.

For older versions of Python, the backports.zstd library is available.


I have locally applied the following patch to your tests:

diff --git a/test/test_zipfile.py b/test/test_zipfile.py
index 4f39ea6..5bccef0 100644
--- a/test/test_zipfile.py
+++ b/test/test_zipfile.py
@@ -13,8 +13,10 @@ mydir = os.path.abspath(os.path.dirname(__file__))
 sys.path.append(os.path.join(mydir,'..'))
 os.chdir(mydir)
 
-import zipfile
-import zipfile_zstd
+if sys.version_info >= (3, 14):
+    import zipfile
+else:
+    from backports.zstd import zipfile
 
 info7z  = subprocess.check_output(['7z', 'i'])
 avail7z = {

Then, I ran the tests without installing zipfile-zstd, and they passed successfully on both CPython 3.14.0rc3 and CPython 3.13 (once backports.zstd library is installed).


So unless I'm mistaken, this suggests that the zipfile-zstd library is not needed anymore for users of Python 3.14+ or those using the backport.

Perhaps it is time to consider deprecating the package? I imagine this might bring mixed feelings, and I completely understand as I am going through a similar process for pyzstd. Of course, the decision is entirely yours.

I am taking this opportunity to thank you for this package. While I have not used it personally, the issues on GitHub suggest that it was helpful to the community. Thank you for bridging the gap until “the batteries” are included in Python itself!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions