multiprocessing-safe importlib.resource.files implementation.
Project description
multiprocessing-importlib-resources
Storing the Traversable returned by importlib.resources.files is not save in zipapps using multiple processes.
Use multiprocessing-importlib-resources to make this safe.
For more information see:
- https://discuss.python.org/t/importlib-resources-files-and-multiprocessing/106813/4
- https://github.com/Joshix-1/importlib.resources.files-multiprocessing--bug
- https://github.com/python/cpython/issues/83544
Use as importlib.resources.files replacement
from importlib.resources.abc import Traversable
from multiprocessing_importlib_resources import files
PATH: Traversable = files(__name__)
Patch importlib.resources.files for everyone
from importlib.resources.abc import Traversable
import multiprocessing_importlib_resources
multiprocessing_importlib_resources._patch()
# fine now
from importlib.resources import files
PATH: Traversable = files(__name__)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiprocessing_importlib_resources-0.0.4.tar.gz.
File metadata
- Download URL: multiprocessing_importlib_resources-0.0.4.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb7e76d785d54271f0b1accf16ef6a7750cbb5b8f21194e420e106da82872ec2
|
|
| MD5 |
834ab3ede509eeb7318c382e66f3b051
|
|
| BLAKE2b-256 |
81a3edf04ddea11575647c17770b4d98b9f6d8491376e9ddd97a63ba22ff6cf6
|
File details
Details for the file multiprocessing_importlib_resources-0.0.4-py3-none-any.whl.
File metadata
- Download URL: multiprocessing_importlib_resources-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa17316473c725ca55d5d52f26012284516fd09e438d31a0d6d74e0aa80d8c92
|
|
| MD5 |
ee3b955c74b14ca1cf661b97b6a6c1bf
|
|
| BLAKE2b-256 |
42575265df786dc4c4b22fa62c878efda2e8a2980f2c25e6b574a4e2661e86db
|