Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Pickling of exhausted generator objects fails #130

Description

Originally reported by: Anselm Kruis (Bitbucket: akruis, GitHub: akruis)


If you pickle an exhausted generator you get a SystemError (2.7-slp) or an access violation (3.x). The cause for this bug is obvious: generator->gi_frame is NULL and pricklepit.c gen_reduce() does not handle this situation.

The fix is simple: change gen_reduce() to return Py_None, if generator->gi_frame is NULL. change gen_setstate() to set gen->gi_frame to NULL, if the frame is Py_None.


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions