Message226528
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. |
|
Date |
User |
Action |
Args |
2014-09-07 04:07:08 | martin.panter | set | recipients:
+ martin.panter |
2014-09-07 04:07:08 | martin.panter | set | messageid: <1410062828.01.0.535616885323.issue22351@psf.upfronthosting.co.za> |
2014-09-07 04:07:07 | martin.panter | link | issue22351 messages |
2014-09-07 04:07:07 | martin.panter | create | |
|