You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(reassembly): Deferred(Generic[_KT]) still fails to pickle under protocol 0/1 on GraalPy #2433
Deferred(Generic[_KT]) still fails to pickle under protocol 0/1 on GraalPy, after #2424 explicitly added __getstate__/__setstate__ to fix exactly this for CPython. Found via the experimental: main push runs Discussion thread (run 40909721813, commit 857bd522e), Python graalpy-25.4 (experimental) leg, non-blocking but a real defect:
state = base(self)
TypeError: typing.Generic() takes no arguments
/opt/hostedtoolcache/GraalPy/25.4.4/x64/lib/python3.13/copyreg.py:71: TypeError
Root cause: for pickle protocol < 2, copyreg._reduce_ex walks cls.__mro__before consulting __getstate__, looking for the first base that is not a heap type (or whose __new__ is bound to itself) to compute a base-object state via base(self). On CPython that walk passes through Generic and lands on object (so state = None). On GraalPy, Generic.__new__ apparently satisfies the walk's stopping condition, so base resolves to Generic itself, and Generic(self) raises — #2424's __getstate__/__setstate__ only supplies the dict half of the reduction, not this base-object half, so it doesn't help.
Likely fix: implement Deferred.__reduce_ex__ (or __reduce__) directly for protocol 0/1, bypassing copyreg._reduce_ex's MRO walk entirely, rather than relying on __getstate__ alone — or drop the Generic[_KT] base if it's not load-bearing at runtime (it was added by #2417/#2418 for static typing only, Deferred.__subclasses__/runtime behavior doesn't depend on it).
Non-blocking (experimental GraalPy leg), but real — #2423/#2424's own test file is what's catching it.
Activity
fix(reassembly): bypass copyreg's MRO walk for Deferred's protocol<2 …
fix(reassembly): bypass copyreg's MRO walk for Deferred's protocol<2 …
fix(reassembly): bypass copyreg's MRO walk for Deferred's protocol<2 …
fix(reassembly): bypass copyreg's MRO walk for Deferred's protocol<2 …