Message382391
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()
--- |
|
Date |
User |
Action |
Args |
2020-12-03 09:16:40 | vstinner | set | recipients:
+ vstinner, rhettinger, serhiy.storchaka, brandtbucher |
2020-12-03 09:16:40 | vstinner | set | messageid: <1606987000.48.0.186265496124.issue42536@roundup.psfhosted.org> |
2020-12-03 09:16:40 | vstinner | link | issue42536 messages |
2020-12-03 09:16:40 | vstinner | create | |
|