[New-bugs-announce] [issue10068] global objects created in some module are not destroyed when last reference to that module is released

Valery Lesin report at bugs.python.org
Tue Oct 12 12:09:28 CEST 2010


New submission from Valery Lesin <valery.lesin at gmail.com>:

Interpreter: Python 3.1.2

Sample:

===== first.py =====
import sys
import second 

if 'second' in sys.modules:
  print ('in sys modules')
  del sys.modules['second']

del second

===== second.py =====
class A:
 def __init__(self):
   print('created')

 def __del__(self):
   print('destroyed')

a = A()
---------------------------------------------

Result: 'destroyed' isn't printed
With Python 2.6.5 it worked fine

----------
components: Interpreter Core
messages: 118408
nosy: Valery.Lesin
priority: normal
severity: normal
status: open
title: global objects created in some module are not destroyed when last reference to that module is released
type: behavior
versions: Python 3.1, Python 3.2

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


More information about the New-bugs-announce mailing list