New submission from James Bowman <bowmana...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue10150>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to