GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-132983: Introduce `compression` package and move `_compression` module by emmatyping · Pull Request #133018 · python/cpython

Conversation

@emmatyping

@emmatyping emmatyping commented Apr 26, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This is part 1 of the Implementation Plan for PEP 784.

This change:

  • introduces a compression package and re-exports existing modules under that package.
  • Moves Lib/_compression.py to Lib/compression/_common/streams.py and updates imports to match.

I added skip news as I'd like to write a holistic NEWS/What's New entry once the entire implementation has landed. If people think each PR should have NEWS I can write something up.

  • Issue: Implement PEP 784 - Adding Zstandard to the Python standard library #132983

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
emmatyping added 2 commits April 15, 2025 19:14
@emmatyping
Introduce compression package
2a6b0f7
This commit introduces the `compression` package, specified in PEP 784
to re-export the `lzma`, `bz2`, `gzip`, and `zlib` modules. Introduction
of `compression.zstd` will be completed in a future commit once the
`_zstd` module is merged.

This commit also moves the `_compression` private module to
`compression._common.streams`.
@emmatyping
Merge branch 'python:main' into compression_package
586a48d
@emmatyping emmatyping added the skip news label Apr 26, 2025
@bedevere-app bedevere-app Bot added the awaiting review label Apr 26, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Apr 26, 2025
Implement PEP 784 - Adding Zstandard to the Python standard library #132983
Closed
13 tasks done
@emmatyping
emmatyping requested a review from gpshead April 26, 2025 17:22
@picnixz

picnixz commented Apr 26, 2025

Copy link
Copy Markdown
Member

(You need to run make regen-stdlib-module-names for the stdlib module names to be updated)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 26, 2025
View reviewed changes
Comment thread Lib/gzip.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/lzma.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@emmatyping

emmatyping commented Apr 26, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@picnixz

(You need to run make regen-stdlib-module-names for the stdlib module names to be updated)

Yeah, unfortunately generate_stdlib_module_names.py doesn't seem to handle nested packages, so I am fixing that so compression.* will be included.

E: s/modules/packages/

picnixz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

emmatyping added 2 commits April 26, 2025 11:27
@emmatyping
Update stdlib modules list
0d7e1db
Also update `generate_stdlib_module_names.py` to collect `compression`,
a namespace package.
@emmatyping
Sort lzma import in alphabetical order
095abfe
picnixz
picnixz reviewed Apr 26, 2025
View reviewed changes
Comment thread Lib/bz2.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@emmatyping
More import sorting
0731130
picnixz
picnixz approved these changes Apr 26, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some imports are not sorted but they are part of the test and tests imports don't follow a specific convention (unless we manage to). In general, we try to keep the convention within the same file.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 26, 2025
@emmatyping

emmatyping commented Apr 26, 2025

Copy link
Copy Markdown
Member Author

Some imports are not sorted but they are part of the test and tests imports don't follow a specific convention

Good to know, sorry I am not very familiar with the import ordering conventions!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Apr 26, 2025

Copy link
Copy Markdown
Member

Good to know, sorry I am not very familiar with the import ordering conventions!

Officially, there is no convention so it's fine! The modules I maintain have sorted imports because it's easier to find what I want but other modules have what I call chronological imports (i.e., once you need another module, a new line is added). There are benefits in both: the first is "purer" (although it's subjective) while the latter eases diffs.

I try to minimize the diffs in general even if it goes against my own conventions (and minimizing the diff is generally achieved by keeping the same convention as the current file).

StanFromIreland reacted with thumbs up emoji emmatyping reacted with heart emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead
gpshead reviewed Apr 26, 2025
View reviewed changes
Comment thread Lib/bz2.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/compression/bz2/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra reviewed Apr 26, 2025
View reviewed changes
Comment thread Tools/build/generate_stdlib_module_names.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

emmatyping added 3 commits April 26, 2025 14:44
@emmatyping
Rename compression._common.streams to compression._common._streams
c8201ba
@emmatyping
Re-export existing module docstrings
e7fed14
@emmatyping
Add compression/__init__.py and revert tooling change
2e1b2a8
@emmatyping
emmatyping force-pushed the compression_package branch from 46c7e21 to 2e1b2a8 Compare April 26, 2025 23:36
gpshead
gpshead approved these changes Apr 27, 2025
View reviewed changes
@gpshead
gpshead merged commit 20be6ba into python:main Apr 27, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 27, 2025
@bedevere-bot

bedevere-bot commented Apr 27, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Debian Installed with X 3.x (no tier) has failed when building commit 20be6ba.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1244/builds/5137) and take a look at the build logs.
  4. Check if the failure is related to this commit (20be6ba) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1244/builds/5137

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/shutil.py"�[0m, line �[35m1331�[0m, in �[35m_unpack_tarfile�[0m
    tarobj = tarfile.open(filename)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/tarfile.py"�[0m, line �[35m1866�[0m, in �[35mopen�[0m
    raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
�[1;35mtarfile.ReadError�[0m: �[35mfile could not be opened successfully:
- method gz: CompressionError('gzip module is not available')
- method bz2: CompressionError('bz2 module is not available')
- method xz: CompressionError('lzma module is not available')
- method tar: ReadError('truncated header')�[0m


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/libregrtest/single.py", line 210, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/libregrtest/single.py", line 155, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 762, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_lzma.py", line 9, in <module>
    from compression._common import _streams
ModuleNotFoundError: No module named 'compression'
�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m1691�[0m, in �[35mtest_make_tarfile_without_rootdir�[0m
    �[31mself.assertTrue�[0m�[1;31m(tarfile.is_tarfile(archive))�[0m
    �[31m~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
�[1;35mAssertionError�[0m: �[35mFalse is not true�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2150�[0m, in �[35mtest_unpack_archive_gztar�[0m
    �[31mself.check_unpack_tarball�[0m�[1;31m('gztar')�[0m
    �[31m~~~~~~~~~~~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2142�[0m, in �[35mcheck_unpack_tarball�[0m
    �[31mself.check_unpack_archive�[0m�[1;31m(format, filter='fully_trusted')�[0m
    �[31m~~~~~~~~~~~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2111�[0m, in �[35mcheck_unpack_archive�[0m
    �[31mself.check_unpack_archive_with_converter�[0m�[1;31m(�[0m
    �[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~�[0m�[1;31m^�[0m
        �[1;31mformat, lambda path: path, **kwargs)�[0m
        �[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2127�[0m, in �[35mcheck_unpack_archive_with_converter�[0m
    �[31munpack_archive�[0m�[1;31m(converter(filename), converter(tmpdir2), **kwargs)�[0m
    �[31m~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/shutil.py"�[0m, line �[35m1415�[0m, in �[35munpack_archive�[0m
    �[31mfunc�[0m�[1;31m(filename, extract_dir, **kwargs)�[0m
    �[31m~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/shutil.py"�[0m, line �[35m1333�[0m, in �[35m_unpack_tarfile�[0m
    raise ReadError(
        "%s is not a compressed or uncompressed tar file" % filename)
�[1;35mshutil.ReadError�[0m: �[35m/tmp/test_python_9h9mmz_c/test_python_21506æ/tmpt7gkyxui/archive.tar.gz is not a compressed or uncompressed tar file�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m1961�[0m, in �[35mtest_tarfile_root_owner�[0m
    archive = tarfile.open(archive_name)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/tarfile.py"�[0m, line �[35m1866�[0m, in �[35mopen�[0m
    raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
�[1;35mtarfile.ReadError�[0m: �[35mfile could not be opened successfully:
- method gz: CompressionError('gzip module is not available')
- method bz2: CompressionError('bz2 module is not available')
- method xz: CompressionError('lzma module is not available')
- method tar: ReadError('truncated header')�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2150�[0m, in �[35mtest_unpack_archive_gztar�[0m
    �[31mself.check_unpack_tarball�[0m�[1;31m('gztar')�[0m
    �[31m~~~~~~~~~~~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2142�[0m, in �[35mcheck_unpack_tarball�[0m
    �[31mself.check_unpack_archive�[0m�[1;31m(format, filter='fully_trusted')�[0m
    �[31m~~~~~~~~~~~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2111�[0m, in �[35mcheck_unpack_archive�[0m
    �[31mself.check_unpack_archive_with_converter�[0m�[1;31m(�[0m
    �[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~�[0m�[1;31m^�[0m
        �[1;31mformat, lambda path: path, **kwargs)�[0m
        �[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m2127�[0m, in �[35mcheck_unpack_archive_with_converter�[0m
    �[31munpack_archive�[0m�[1;31m(converter(filename), converter(tmpdir2), **kwargs)�[0m
    �[31m~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/shutil.py"�[0m, line �[35m1415�[0m, in �[35munpack_archive�[0m
    �[31mfunc�[0m�[1;31m(filename, extract_dir, **kwargs)�[0m
    �[31m~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/shutil.py"�[0m, line �[35m1333�[0m, in �[35m_unpack_tarfile�[0m
    raise ReadError(
        "%s is not a compressed or uncompressed tar file" % filename)
�[1;35mshutil.ReadError�[0m: �[35m/tmp/test_python_dbw2aaxz/test_python_13358æ/tmp39bg5feu/archive.tar.gz is not a compressed or uncompressed tar file�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m1757�[0m, in �[35mtest_tarfile_vs_tar�[0m
    self.assertEqual(�[31mself._tarinfo�[0m�[1;31m(tarball)�[0m, self._tarinfo(tarball2))
                     �[31m~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_shutil.py"�[0m, line �[35m1620�[0m, in �[35m_tarinfo�[0m
    with �[31mtarfile.open�[0m�[1;31m(path)�[0m as tar:
         �[31m~~~~~~~~~~~~�[0m�[1;31m^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/tarfile.py"�[0m, line �[35m1866�[0m, in �[35mopen�[0m
    raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
�[1;35mtarfile.ReadError�[0m: �[35mfile could not be opened successfully:
- method gz: CompressionError('gzip module is not available')
- method bz2: CompressionError('bz2 module is not available')
- method xz: CompressionError('lzma module is not available')
- method tar: ReadError('truncated header')�[0m


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/libregrtest/single.py", line 210, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/libregrtest/single.py", line 155, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 762, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_bz2.py", line 19, in <module>
    from compression._common import _streams
ModuleNotFoundError: No module named 'compression'
�[0m
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Apr 27, 2025

Copy link
Copy Markdown
Member

Fails are related.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@emmatyping

emmatyping commented Apr 27, 2025

Copy link
Copy Markdown
Member Author

Yes, it looks like I need to add the compression packages to Makefile.pre.in to install. Just verifying the fix works before pushing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Apr 27, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.x (tier-3) has failed when building commit 20be6ba.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1380/builds/3412) and take a look at the build logs.
  4. Check if the failure is related to this commit (20be6ba) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1380/builds/3412

Failed tests:

  • test_shutil
  • test_bz2
  • test_largefile
  • test_lzma

Failed subtests:

  • test_make_tarfile_without_rootdir - test.test_shutil.TestArchives.test_make_tarfile_without_rootdir
  • test_it - test.test_largefile.TestSocketSendfile.test_it
  • test_unpack_archive_gztar - test.test_shutil.TestArchives.test_unpack_archive_gztar

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_largefile.py", line 183, in wrapper
    return fun(*args, **kwargs)
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_largefile.py", line 247, in test_it
    with socket.create_server(("", port)) as sock:
         ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/socket.py", line 955, in create_server
    raise error(err.errno, msg) from None
OSError: [Errno 48] Address already in use (while attempting to bind on address ('', 51418))


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/libregrtest/single.py", line 210, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/libregrtest/single.py", line 155, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 762, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_bz2.py", line 19, in <module>
    from compression._common import _streams
ModuleNotFoundError: No module named 'compression'


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 1691, in test_make_tarfile_without_rootdir
    self.assertTrue(tarfile.is_tarfile(archive))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/libregrtest/single.py", line 210, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/libregrtest/single.py", line 155, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1398, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 762, in exec_module
  File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_lzma.py", line 9, in <module>
    from compression._common import _streams
ModuleNotFoundError: No module named 'compression'


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/threading.py", line 1079, in _bootstrap_inner
    self._context.run(self.run)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/threading.py", line 1021, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_interpreters/test_stress.py", line 47, in run
    interp = interpreters.create()
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/support/interpreters/__init__.py", line 76, in create
    id = _interpreters.create(reqrefs=True)
interpreters.InterpreterError: interpreter creation failed
k


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2150, in test_unpack_archive_gztar
    self.check_unpack_tarball('gztar')
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2142, in check_unpack_tarball
    self.check_unpack_archive(format, filter='fully_trusted')
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2111, in check_unpack_archive
    self.check_unpack_archive_with_converter(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        format, lambda path: path, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2127, in check_unpack_archive_with_converter
    unpack_archive(converter(filename), converter(tmpdir2), **kwargs)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/shutil.py", line 1415, in unpack_archive
    func(filename, extract_dir, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/shutil.py", line 1333, in _unpack_tarfile
    raise ReadError(
        "%s is not a compressed or uncompressed tar file" % filename)
shutil.ReadError: /Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Data/Application/F8E92DEC-C566-4A92-AE44-01AF3D6FCF16/tmp/test_python_worker_6059æ/tmp68ejuorz/archive.tar.gz is not a compressed or uncompressed tar file


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2150, in test_unpack_archive_gztar
    self.check_unpack_tarball('gztar')
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2142, in check_unpack_tarball
    self.check_unpack_archive(format, filter='fully_trusted')
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2111, in check_unpack_archive
    self.check_unpack_archive_with_converter(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        format, lambda path: path, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/test/test_shutil.py", line 2127, in check_unpack_archive_with_converter
    unpack_archive(converter(filename), converter(tmpdir2), **kwargs)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/shutil.py", line 1415, in unpack_archive
    func(filename, extract_dir, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/shutil.py", line 1333, in _unpack_tarfile
    raise ReadError(
        "%s is not a compressed or uncompressed tar file" % filename)
shutil.ReadError: /Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Data/Application/F8E92DEC-C566-4A92-AE44-01AF3D6FCF16/tmp/test_python_worker_6059æ/tmpnvbljx7y/archive.tar.gz is not a compressed or uncompressed tar file


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/shutil.py", line 1331, in _unpack_tarfile
    tarobj = tarfile.open(filename)
  File "/Users/buildbot/Library/Developer/XCTestDevices/3A404F41-86B9-4CE5-9415-6BD112E026F5/data/Containers/Bundle/Application/B0D420F9-4362-48F1-823E-B6F074B20BF5/iOSTestbed.app/python/lib/python3.14/tarfile.py", line 1866, in open
    raise ReadError(f"file could not be opened successfully:\134n{error_msgs_summary}")
tarfile.ReadError: file could not be opened successfully:
- method gz: CompressionError('gzip module is not available')
- method bz2: CompressionError('bz2 module is not available')
- method xz: CompressionError('lzma module is not available')
- method tar: ReadError('truncated header')
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@emmatyping

emmatyping commented Apr 27, 2025

Copy link
Copy Markdown
Member Author

PR with fix: #133063

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

merwok
merwok reviewed May 12, 2025
View reviewed changes
Comment thread Lib/compression/gzip/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Rogdham Rogdham mentioned this pull request Jul 13, 2025
gh-132983: Add missing references to Zstandard in shutil docstrings #136617
Merged
@joebonrichie joebonrichie mentioned this pull request May 30, 2026
Adjust import path of private compression module for python 3.14 isarandi/lzma-mt#2
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merwok merwok merwok left review comments
@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@StanFromIreland StanFromIreland StanFromIreland left review comments
@gpshead gpshead gpshead approved these changes
@picnixz picnixz picnixz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@emmatyping @picnixz @bedevere-bot @StanFromIreland @gpshead @merwok @JelleZijlstra
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.