This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients brandtbucher, rhettinger, serhiy.storchaka, vstinner
Date 2020-12-03.09:16:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606987000.48.0.186265496124.issue42536@roundup.psfhosted.org>
In-reply-to
Content
test_zip_leak2.py: simplified example to trigger the GC issue.

Copy it to Lib/test/ and reproduce the leak with:

    ./python -m test -R 3:3 test_zip_leak2

Extract of the code:
---
container = []
iterator = zip([container], [container])

# untrack the internal zip->result=(None, None)
gc.collect()

# create a reference cycle: container -> iterator -> container
container.append(iterator)

next(iterator)
# zip->result=(container, container)

del container, iterator

# Try to break the reference cycle
gc.collect()
---
History
Date User Action Args
2020-12-03 09:16:40vstinnersetrecipients: + vstinner, rhettinger, serhiy.storchaka, brandtbucher
2020-12-03 09:16:40vstinnersetmessageid: <1606987000.48.0.186265496124.issue42536@roundup.psfhosted.org>
2020-12-03 09:16:40vstinnerlinkissue42536 messages
2020-12-03 09:16:40vstinnercreate