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 xtreak
Recipients maggyero, xtreak
Date 2018-06-28.07:13:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530170004.48.0.56676864532.issue33978@psf.upfronthosting.co.za>
In-reply-to
Content
I think while initializing it on the second call we just delete the handlers list variable which contains references to the file handlers instead of properly closing them like it's done in shutdown. handlers is a list of weakreferences and I don't know if they will close file handlers or other resources automatically as they are deleted. If the initialization is done in a loop involving threads then there might be others who are using the handlers as we delete them. The attached patch tries to close the handlers before deletion thus removing the warning. The same is observed in FileConfig too where handlers list is deleted before removal.

shutdown method : https://github.com/python/cpython/blob/master/Lib/logging/__init__.py#L1994
deletion of handlers before closing them : https://github.com/python/cpython/blob/master/Lib/logging/config.py#L528

I think this is merged from Python 2.7 with commit https://github.com/python/cpython/commit/00ee7baf49430d8a6eed355a5fd7a05179325747 12 years back but doesn't produce any effect on Python 2.7 does -W all or -Wall have any effect ? 


Thanks
History
Date User Action Args
2018-06-28 07:13:24xtreaksetrecipients: + xtreak, maggyero
2018-06-28 07:13:24xtreaksetmessageid: <1530170004.48.0.56676864532.issue33978@psf.upfronthosting.co.za>
2018-06-28 07:13:24xtreaklinkissue33978 messages
2018-06-28 07:13:24xtreakcreate