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 martin.panter
Recipients martin.panter, vstinner
Date 2017-09-25.12:07:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I’m curious how you manage to trigger the warning in the “closed” state. The Python I have handy is half a year out of date, but all my attempts to trigger the warning either produce the less confusing version,

ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('', 0)>

or there is no warning at all due IOBase.__del__ (see Issue 19829).

If your SocketIO was wrapped in a BufferedReader/Writer/RWPair, then that could easily close the SocketIO object before SocketIO.__del__ is called. You would also have to override the wrapper’s __del__ method, rather than (or as well as) SocketIO.__del__.
Date User Action Args
2017-09-25 12:07:00martin.pantersetrecipients: + martin.panter, vstinner
2017-09-25 12:07:00martin.pantersetmessageid: <>
2017-09-25 12:07:00martin.panterlinkissue31520 messages
2017-09-25 12:07:00martin.pantercreate