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
Date 2014-09-07.04:07:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410062828.01.0.535616885323.issue22351@psf.upfronthosting.co.za>
In-reply-to
Content
If the nntplib.NNTP constructor fails, it often leaves the connection and socket open until the garbage collector cleans them up and emits a ResourceWarning:

>>> try:
...     NNTP("localhost")
... except Exception as err:
...     print(repr(err))
... 
NNTPTemporaryError('400 Service temporarily unavailable',)
>>> gc.collect()
__main__:1: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 54819), raddr=('127.0.0.1', 119)>
12

This happens both for error responses that are expected by the protocol, e.g. service unavailable as above, authentication errors. It also happens for other exceptions such as EOFError if the connection is closed with no response.
History
Date User Action Args
2014-09-07 04:07:08martin.pantersetrecipients: + martin.panter
2014-09-07 04:07:08martin.pantersetmessageid: <1410062828.01.0.535616885323.issue22351@psf.upfronthosting.co.za>
2014-09-07 04:07:07martin.panterlinkissue22351 messages
2014-09-07 04:07:07martin.pantercreate