Message302949
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.0.0.0', 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:00 | martin.panter | set | recipients:
+ martin.panter, vstinner |
2017-09-25 12:07:00 | martin.panter | set | messageid: <1506341220.49.0.322214263539.issue31520@psf.upfronthosting.co.za> |
2017-09-25 12:07:00 | martin.panter | link | issue31520 messages |
2017-09-25 12:07:00 | martin.panter | create | |
|