Coroutine state is currently pickled twice, here and here. This PR fixes the issue by requiring that coroutine state is bytes when it reaches the latter. This allows the bundled scheduler to be responsible for serializing the state, where it can check that the state is valid and raise an IncompatibleStateError otherwise.
Coroutine state is currently pickled twice, here and here. This PR fixes the issue by requiring that coroutine state is bytes when it reaches the latter. This allows the bundled scheduler to be responsible for serializing the state, where it can check that the state is valid and raise an
IncompatibleStateError
otherwise.