Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved generator finalization #43153

Closed
pjeby mannequin opened this issue Apr 3, 2006 · 5 comments
Closed

Improved generator finalization #43153

pjeby mannequin opened this issue Apr 3, 2006 · 5 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@pjeby
Copy link
Mannequin

pjeby mannequin commented Apr 3, 2006

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']

    @pjeby
    Copy link
    Mannequin Author

    pjeby mannequin commented Apr 3, 2006

    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.

    @pjeby pjeby mannequin closed this as completed Apr 3, 2006
    @pjeby pjeby mannequin self-assigned this Apr 3, 2006
    @pjeby pjeby mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 3, 2006
    @pjeby pjeby mannequin closed this as completed Apr 3, 2006
    @pjeby pjeby mannequin self-assigned this Apr 3, 2006
    @pjeby pjeby mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 3, 2006
    @tim-one
    Copy link
    Member

    tim-one commented Apr 5, 2006

    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. :-( )

    @pjeby
    Copy link
    Mannequin Author

    pjeby mannequin commented Apr 5, 2006

    Logged In: YES
    user_id=56214

    Argh. Sorry. Uploaded.

    @Yhg1s
    Copy link
    Member

    Yhg1s commented Apr 9, 2006

    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.

    @pjeby
    Copy link
    Mannequin Author

    pjeby mannequin commented Apr 10, 2006

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants