[Python-bugs-list] [ python-Bugs-449258 ] inspect.stack() refcount problem
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 08 Aug 2001 12:45:40 -0700
Bugs item #449258, was opened at 2001-08-08 12:35
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449258&group_id=5470
Category: Python Interpreter Core
>Group: Not a Bug
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: W. Eliot Kimber (drmacro)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: inspect.stack() refcount problem
Initial Comment:
The attached code exhibits the problem: Calling a
function that assigns the results of inspect.stack()
to a local variable causes an extra ref to objects in
the caller's space. Not doing the assignment does not
cause the problem.
Appears that the stack frame is disrupting the
reference counting in some way.
Tested with Python 2.1 and 2.1.1
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-08 12:45
Message:
Logged In: YES
user_id=6380
Your attachment didn't work.
But don't bother. The behavior you describe is not a bug.
It creates a circular reference. If you don't want that,
don't use
inspect.stack() or sys._getframe() (which is the same
thing).
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449258&group_id=5470