Install & Compatibility
Where this runs
tested against v3.13.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.002s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.002s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
chunk
✓ import chunk
✗ import chunk # on Python 3.13+
The `chunk` module was removed from the standard library in Python 3.13. For Python 3.13 and later, `standard-chunk` must be installed to use `import chunk`.
After installing `standard-chunk`, modules like `chunk` can be imported and used as if they were still part of the Python standard library. This example demonstrates basic usage of the `chunk` module to read simulated IFF-like data.
import io
import chunk
# Simulate a file-like object with some IFF-like data
# (simplified for demonstration, actual IFF files are more complex)
iff_data = b'FORM\x00\x00\x00\x18TESTCHANKS\x00\x00\x00\x08DATA\x00\x00\x00\x04abcd'
f = io.BytesIO(iff_data)
try:
# Create a Chunk object from a file-like object
ck = chunk.Chunk(f)
print(f"Chunk ID: {ck.getname().decode('ascii')}")
print(f"Chunk Size: {ck.getsize()}")
# Read some data from the chunk
data_read = ck.read(4)
print(f"Data read: {data_read}")
# Seek within the chunk
ck.seek(0)
data_read_again = ck.read(4)
print(f"Data read again after seek: {data_read_again}")
ck.close()
except Exception as e:
print(f"An error occurred: {e}")
# Example for another 'dead battery' module, asyncore
# try:
# import asyncore
# print("asyncore imported successfully.")
# except ImportError:
# print("asyncore not found, install standard-asyncore if needed.")
Debug
Known issues
breakingThe primary `chunk` module was officially removed from the Python standard library in Python 3.13. Without `standard-chunk` installed, `import chunk` will raise an `ImportError` on Python 3.13 and newer versions.fixInstall `standard-chunk` via `pip install standard-chunk` in your environment.
affects: Python >=3.13
gotchaThe `distutils` module, also redistributed by `python-deadlib` (the upstream project for `standard-chunk`), is explicitly noted as 'Not working on Python 3.13'. While `standard-chunk` provides the `chunk` module, users depending on other dead batteries should check specific compatibility notes.fixFor `distutils`, avoid its use on Python 3.13+ or seek alternative modern packaging solutions like `setuptools`.
affects: Python 3.13.0 and newer for `distutils`
gotchaThis library is intended for compatibility with removed standard library modules. It explicitly states it does NOT accept new features or anything beyond minimal compatibility work. Attempting to contribute new features or significant changes will likely be rejected.fixTreat this library as a 'polyfill' for legacy code. For new development or enhanced functionality, seek actively maintained alternatives.
affects: All versions
gotchaAs 'dead batteries', the modules provided by `standard-chunk` are not actively maintained for new features or modern best practices. They are provided as-is for compatibility and might not integrate well with contemporary Python ecosystems.fixEvaluate if an alternative, actively developed library exists for your use case before relying on a 'dead battery' module for new development.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aifc'
The `aifc` module was removed from the Python standard library in Python 3.11 as per PEP 594.
fixpip install standard-chunk
import aifc
ModuleNotFoundError: No module named 'cgi'
The `cgi` module was removed from the Python standard library in Python 3.11 as per PEP 632.
fixpip install standard-chunk
import cgi
ModuleNotFoundError: No module named 'asynchat'
The `asynchat` module was removed from the Python standard library in Python 3.11 as per PEP 594.
fixpip install standard-chunk
import asynchat
ModuleNotFoundError: No module named 'chunk'
The `chunk` module was removed from the Python standard library in Python 3.11 as per PEP 594.
fixpip install standard-chunk
import chunk
Upgrade
Version history
3.13.0latest on PyPI · released Oct 30, 2024
Audit
Dependencies
No dependency data recorded yet.