[New-bugs-announce] [issue10150] Local references not released after exception

James Bowman report at bugs.python.org
Wed Oct 20 06:01:47 CEST 2010


New submission from James Bowman <bowmanator at gmail.com>:

import sys

def foo():
    x = [o] * 100
    raise ArithmeticError

o = "something"
print sys.getrefcount(o)
try:
    foo()
except ArithmeticError:
    pass
print sys.getrefcount(o)

-------------------------------------------

Gives:

4
104


Looking at the CPython source, FrameObject's deallocator does actually decrement refcounts of its locals and arguments.  Guessing that the FrameObject is not being deallocated.

----------
components: Interpreter Core
messages: 119187
nosy: James.Bowman
priority: normal
severity: normal
status: open
title: Local references not released after exception
type: resource usage
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10150>
_______________________________________


More information about the New-bugs-announce mailing list