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.

Author serhiy.storchaka
Recipients martin.panter, serhiy.storchaka
Date 2015-04-08.10:44:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428489899.44.0.0595864360872.issue23865@psf.upfronthosting.co.za>
In-reply-to
Content
Ah, yet one purpose of the patch is to make close() methods more robust when called at shutdown. Objects can be partially deconstructed at that time, attributes can be set to None to break reference loops. That is why I use None as signaling value and always check some attribute for None.

The changes to aifc make sense. close() is called from __exit__(). When context manager is used in a generator, it creates a reference loop. So self.file is None in this case and self.file.close() will raise an AttributeError.
History
Date User Action Args
2015-04-08 10:44:59serhiy.storchakasetrecipients: + serhiy.storchaka, martin.panter
2015-04-08 10:44:59serhiy.storchakasetmessageid: <1428489899.44.0.0595864360872.issue23865@psf.upfronthosting.co.za>
2015-04-08 10:44:59serhiy.storchakalinkissue23865 messages
2015-04-08 10:44:59serhiy.storchakacreate