[issue35030] Python 2.7 OrderedDict creates circular references

Karthikeyan Singaravelan report at bugs.python.org
Sat Oct 20 11:05:33 EDT 2018


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

Thanks for the report. I have converted the numpy code as a python helper and I am not sure if such a helper exists in the current test suite. Attaching the file that might help as a simple reproducer.

# On master no error

➜  cpython git:(master) ./python.exe ../backups/bpo35030.py

# upstream/2.7 branch

➜  cpython git:(2bad7acdfe) ✗ ./python.exe ../backups/bpo35030.py
Traceback (most recent call last):
  File "../backups/bpo35030.py", line 60, in <module>
    del a
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "../backups/bpo35030.py", line 53, in assert_no_gc_cycles
    ) for o in objects_in_cycles
AssertionError: Reference cycles were found: 1 objects were collected, of which 1 are shown below:
  list object with id=4475647608:
    [<Recursion on list with id=4475647608>,
     <Recursion on list with id=4475647608>,
     None]

----------
nosy: +xtreak
Added file: https://bugs.python.org/file47885/bpo35030.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35030>
_______________________________________


More information about the Python-bugs-list mailing list