This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_sys reference counting fails while tracing
Type: Stage:
Components: Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: dugan, georg.brandl
Priority: normal Keywords: patch

Created on 2009-03-31 23:22 by dugan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
refcount.patch dugan, 2009-03-31 23:22 Patch to make refcount test pass under settrace.
Messages (2)
msg84946 - (view) Author: David Christian (dugan) Date: 2009-03-31 23:22
test_sys refcount test checks that assigning None to a local variable n
increases the references to None by exactly 1.

However sys.settrace is set, then the frame object must be instantiated
to be passed to the trace object.  This increments the reference count
to None again.  Since the locals are not then removed from the frame
object after the sys.settrace call, the number of references remains
increased after the settrace function is exited.

This problem can be avoided by making n a global.
msg84952 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-01 00:04
Committed in r70933. Thanks!
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49885
2009-04-01 00:04:41georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg84952

resolution: accepted
2009-03-31 23:22:09dugancreate