[pypy-issue] [issue689] RPython exception unpickling a coroutine whose creator's stack has shrunk since it was switch()'d

Carl Friedrich Bolz tracker at bugs.pypy.org
Wed Apr 23 11:58:28 CEST 2014


Carl Friedrich Bolz <cfbolz at gmx.de> added the comment:

FWIW, this kind of code passes nowadays, so I am closing this issue:

import pickle
import stackless
h = None
main_coro = stackless.coroutine.getcurrent()

def f():
   g()
   global h
   new_coro = stackless.coroutine()
   new_coro.bind(lambda x: x, 5)
   h = pickle.dumps(new_coro)

def g():
   main_coro.switch()

user_coro = stackless.coroutine()
user_coro.bind(f)

user_coro.switch()
user_coro.switch()
pickle.loads(h)

----------
nosy: +cfbolz
status: unread -> resolved

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue689>
________________________________________


More information about the pypy-issue mailing list