[issue22351] NNTP constructor exception leaves socket for garbage collector

Martin Panter report at bugs.python.org
Sun Mar 15 02:58:45 CET 2015


Martin Panter added the comment:

Posting issue22351_nntp_fail_4.patch; changes:

* Merge mixin and main TestCase class; mixins like this are sometimes useful to work around Issue 22351, but not necessary in this case, because there is only one TestCase class involved.
* Turn the local server in the background thread into mock socket object, with makefile() returning a duplex stream object, reusing the existing _NNTPServerIO and NNTPv1Handler classes.
* Test socket closure by checking mock socket and stream objects directly, rather than relying on a lack of ResourceWarning.

----------
Added file: http://bugs.python.org/file38489/issue22351_nntp_fail_4.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22351>
_______________________________________


More information about the Python-bugs-list mailing list