Install & Compatibility
Where this runs
tested against v0.2.5 · 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.056s · 17.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.048s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
open
✓ from mgzip import open
✗ import gzip (then using gzip.open)
Using gzip.open instead of mgzip.open won't use multithreading.
compress
✓ from mgzip import compress
decompress
✓ from mgzip import decompress
Basic usage of mgzip.open for writing and reading gzip files with multiple threads.
from mgzip import open
# Multithreaded gzip compression
with open('example.txt.gz', 'wt', compresslevel=5, thread=4) as f:
f.write('Hello, world!')
# Multithreaded decompression
with open('example.txt.gz', 'rt', thread=4) as f:
print(f.read())
Errors
Common errors & fixes
AttributeError: '_MultiGzipReader' object has no attribute '_read_exact'
Python 3.12+ removed internal gzip._read_exact method.
fixUpgrade mgzip to >=0.2.3.
AttributeError: 'Decompress' object has no attribute 'unconsumed_tail'
Python 3.12+ changed zlib decompressobj API.
fixUpgrade mgzip to >=0.2.3.
ResourceWarning: unclosed <socket> for multiprocessing pool
Multiprocessing pool not cleaned properly in mgzip <0.2.2.
fixUpgrade mgzip to >=0.2.2.
TypeError: 'thread' is an invalid keyword argument for this function
Using 'threads' or 'num_threads' instead of 'thread'.
fixUse thread=<N> as keyword argument.
Upgrade
Version history
0.2.5latest on PyPI · released Feb 28, 2026
Audit
Dependencies
No dependency data recorded yet.