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 vstinner
Recipients gvanrossum, vstinner, yselivanov
Date 2015-01-14.23:18:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421277484.12.0.751563251482.issue23243@psf.upfronthosting.co.za>
In-reply-to
Content
I propose to add destructors to transports and event loops which emit a ResourceWarning if they are not closed.

The change should help to detect resource leaks and bugs.

Attached patch implements this issue. It only adds destructors on Python 3.4 and later, because older Python versions don't implement the PEP 442 (Safe object finalization) and so objects part of reference cycle would never be deleted.

The patch adds a new _closed attribute to BaseSubprocessTransport and _SSLProtocolTransport classes, to track if the transport was closed or not.

The patch should help to find bugs like this one:
https://code.google.com/p/tulip/issues/detail?id=218
History
Date User Action Args
2015-01-14 23:18:04vstinnersetrecipients: + vstinner, gvanrossum, yselivanov
2015-01-14 23:18:04vstinnersetmessageid: <1421277484.12.0.751563251482.issue23243@psf.upfronthosting.co.za>
2015-01-14 23:18:04vstinnerlinkissue23243 messages
2015-01-14 23:18:03vstinnercreate