-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Milestone
Description
To support data exchange, being able to serialize non-JSON-serializable GithubObjects has been easily achieved in past with pickle. However, starting with v1.58, GithubObjects like Repository, NamedUser, etc. are no longer serializable with with pickle,
For example,
import github
import pickle
repo = github.Github().get_repo(full_name_or_id="PyGithub/PyGithub")
pickle.dumps(repo)raise the following exception:
Traceback (most recent call last):
File "/Users/joshfell/code/daedalus/tempCodeRunnerFile.python", line 15, in <module>
pickle.dumps(repo)
File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/synchronize.py", line 101, in __getstate__
context.assert_spawning(self)
File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/context.py", line 373, in assert_spawning
raise RuntimeError(
RuntimeError: RLock objects should only be shared between processes through inheritance
The underyling Requester object now has an RLock() attribute, __auth_lock, which looks to be preventing this serialization.
Metadata
Metadata
Assignees
Labels
No labels