Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create lazy loading lookup class to support pickling #82

Merged
merged 12 commits into from Oct 8, 2022

Conversation

parkerhancock
Copy link
Contributor

This addresses #81 by creating a lazy-loading FastLookup object if the root is a string or a pathlib.Path object. By doing this, when either a string or a pathlib.Path is used as a root for a zipp.Path, the path object does not hold an open file handle, and thus can be pickled.

zipp.Path objects that are pickleable can then be passed around multiprocessing libraries without fear of running into the dreaded TypeError: cannot serialize '_io.BufferedReader' object error.

test_zipp.py Outdated Show resolved Hide resolved
zipp.py Outdated Show resolved Hide resolved
zipp.py Outdated Show resolved Hide resolved
zipp.py Outdated Show resolved Hide resolved
test_zipp.py Outdated Show resolved Hide resolved
zipp.py Outdated Show resolved Hide resolved
test_zipp.py Outdated Show resolved Hide resolved
@jaraco jaraco merged commit 952b20e into jaraco:main Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants