Deserializing pickled starlette.applications.Starlette
object fails with RecursionError: maximum recursion depth exceeded
#2308
Unanswered
edoakes
asked this question in
Potential Issue
Replies: 1 comment
-
Any updates? Getting the same error when using dill & multiprocessing manager queue with the starlette app (fastapi) as elements. RemoteError:
---------------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/managers.py", line 253, in serve_client
request = recv()
File "/usr/lib/python3.10/multiprocessing/connection.py", line 251, in recv
return _ForkingPickler.loads(buf.getbuffer())
File "/usr/local/lib/python3.10/dist-packages/dill/_dill.py", line 303, in loads
return load(file, ignore, **kwds)
File "/usr/local/lib/python3.10/dist-packages/dill/_dill.py", line 289, in load
return Unpickler(file, ignore=ignore, **kwds).load()
File "/usr/local/lib/python3.10/dist-packages/dill/_dill.py", line 444, in load
obj = StockUnpickler.load(self)
File "/usr/local/lib/python3.10/dist-packages/starlette/datastructures.py", line 699, in __getattr__
return self._state[key]
File "/usr/local/lib/python3.10/dist-packages/starlette/datastructures.py", line 699, in __getattr__
return self._state[key]
File "/usr/local/lib/python3.10/dist-packages/starlette/datastructures.py", line 699, in __getattr__
return self._state[key]
[Previous line repeated 2984 more times]
RecursionError: maximum recursion depth exceeded
--------------------------------------------------------------------------- |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Starlette apps are not currently pickleable:
This is due to
starlette.datastructures.State
overriding__getattr__
without providing a__reduce__
method.Adding the following method to
State
fixes the issue:Would be happy to submit a patch to fix this.
Beta Was this translation helpful? Give feedback.
All reactions