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: OrderedDict.__del__ destructor throws AttributeError when process ends up with the exception trace
Type: behavior Stage:
Components: Library (Lib), Windows Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: rhettinger, valgog
Priority: low Keywords:

Created on 2010-08-06 11:48 by valgog, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg113096 - (view) Author: Valentine Gogichashvili (valgog) Date: 2010-08-06 11:48
When the process is dying with the exception trace dump, I am getting the following notification from the destructor of the OrderedDict class::

  Exception AttributeError: "'NoneType' object has no attribute 'print_exc'" in <bound method OrderedDict.__del__ of OrderedDict([('key', 'value')])> ignored

In the source of the OrderedDict the only operation that is not included in the try..catch is the dict.clear(self) actually. So I suppose that this problem is in dict.clear() implementation...
msg113108 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-08-06 16:34
Do you have a short script that can reproduce the error message?
msg113109 - (view) Author: Valentine Gogichashvili (valgog) Date: 2010-08-06 16:43
Unfortunately I do not have a short script. It is happening during the failure in quite a big script. I am afraid, it will too time consuming for me to write it... 

Actually by the content of the OrderdDict instance that is throwing this exception it seems like it is the one, that is used by ConfigParser internally.
msg113123 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-08-06 18:56
There's not enough information here for me to follow-up.

It's unlikely that dict.clear() would product the message you see and the existing code for OrderedDict.__del__ and OrderedDict.clear() look correct to me.  The bug may be in your own code.
msg113142 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-08-06 22:48
None of the other python-dev IRC folks were able to deduce the issue from the provided information.  Closing as invalid.  Feel free to reopen if more actionable information becomes available.
History
Date User Action Args
2022-04-11 14:57:05adminsetgithub: 53743
2010-08-06 22:48:00rhettingersetstatus: open -> closed
resolution: not a bug
messages: + msg113142
2010-08-06 18:56:45rhettingersetpriority: normal -> low

messages: + msg113123
2010-08-06 16:43:14valgogsetmessages: + msg113109
2010-08-06 16:34:47rhettingersetmessages: + msg113108
2010-08-06 16:33:15rhettingersetassignee: rhettinger

nosy: + rhettinger
2010-08-06 11:48:04valgogcreate