Skip to content

Improved generator finalization #43153

Closed
Closed

Description

@pjeby
mannequin
BPO 1463867
Nosy @tim-one, @Yhg1s, @pjeby
Files
  • genfinalize.patch: Patch for generator finalization change
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/pjeby'
    closed_at = <Date 2006-04-10.17:53:22.000>
    created_at = <Date 2006-04-03.22:43:11.000>
    labels = ['interpreter-core']
    title = 'Improved generator finalization'
    updated_at = <Date 2006-04-10.17:53:22.000>
    user = 'https://github.com/pjeby'

    bugs.python.org fields:

    activity = <Date 2006-04-10.17:53:22.000>
    actor = 'pje'
    assignee = 'pje'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2006-04-03.22:43:11.000>
    creator = 'pje'
    dependencies = []
    files = ['7139']
    hgrepos = []
    issue_num = 1463867
    keywords = ['patch']
    message_count = 5.0
    messages = ['49954', '49955', '49956', '49957', '49958']
    nosy_count = 3.0
    nosy_names = ['tim.peters', 'twouters', 'pje']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1463867'
    versions = ['Python 2.5']

    Activity

    1. pjeby commented on Apr 3, 2006

      pjebymannequin
      MannequinAuthor

      This patch improves generator finalization such that
      simple generators (without active try/except/finally
      blocks surrounding yield statements) can have their
      cycles broken.

      Please check to see if this patch improves the leaks
      that prompted the request for changing this. Thanks.

    2. self-assigned this
      on Apr 3, 2006
    3. self-assigned this
      on Apr 3, 2006
    4. tim-one commented on Apr 5, 2006

      @tim-one
      Member

      Logged In: YES
      user_id=31435

      There's no uploaded file! You have to check the
      checkbox labeled "Check to Upload & Attach File"
      when you upload a file. In addition, even if you
      *did* check this checkbox, a bug in SourceForge
      prevents attaching a file when *creating* an issue.

      Please try again.

      (This is a SourceForge annoyance that we can do
      nothing about. :-( )

    5. pjeby commented on Apr 5, 2006

      pjebymannequin
      MannequinAuthor

      Logged In: YES
      user_id=56214

      Argh. Sorry. Uploaded.

    6. Yhg1s commented on Apr 9, 2006

      @Yhg1s
      Member

      Logged In: YES
      user_id=34209

      The patch looks alright (although it could use some big
      blinking comments in opcode.h and ceval.c, to make sure
      PyGen_NeedsFinalizer is properly updated when new block
      types are added.) The patch fixes the
      test_generators_cycle.py leaker-test, but it does *not* fix
      the cycles test_generators test. (Obviously after removing
      the code that explicitly breaks the cycle in test_generators.)

      I don't know why it doesn't clean up the test_generators
      cycle. Maybe it's related to doctest, or the way doctests run.

    7. pjeby commented on Apr 10, 2006

      pjebymannequin
      MannequinAuthor

      Logged In: YES
      user_id=56214

      Checked in as of r45235, w/added comment to ceval.c.

      If the test that's leaking doesn't leave a generator
      suspended in a 'with', try/except, or try/finally block,
      then a reference is probably being held somewhere that makes
      it not garbage yet. (Or perhaps it's being referenced by an
      object w/a __del__ method?) Let me know what you find out.

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions