Issue 15193: Exception AttributeError: "'NoneType' object has no attribute (original) (raw)

Issue15193

Created on 2012-06-26 13:05 by prime, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
objectvar.py prime,2012-06-26 13:05
Messages (3)
msg164073 - (view) Author: Mithilesh Kumar (prime) Date: 2012-06-26 13:05
Behavior of the program changes with number of charaters used in variable name. Attached file shows a simple example.
msg164074 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2012-06-26 13:19
The exception you report looks incomplete: there should be something after the 'no attribute' saying which attribute lookup failed. In any case, I don't thing this is a bug. It sounds like a result of the unpredictability of cleanup order at interpreter shutdown: you're encountering a situation where the 'Person' reference has already been deleted from the module namespace before the __del__ method for one of the Person instances gets called; so the 'Person' name lookup in the __del__ method fails. You could get around this by replacing 'Person' with 'type(self)' in __del__.
msg164075 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2012-06-26 13:31
See also this warning message: http://docs.python.org/reference/datamodel.html#object.__del__
History
Date User Action Args
2022-04-11 14:57:32 admin set github: 59398
2012-06-26 13:31:58 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: +
2012-06-26 13:19:10 mark.dickinson set status: open -> closednosy: + mark.dickinsonmessages: + resolution: not a bug
2012-06-26 13:05:20 prime create