classification
Title: nntplib throws spurious NNTPProtocolError
Type: Stage:
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: msapiro
Priority: normal Keywords:

Created on 2019-08-22 17:22 by msapiro, last changed 2019-08-22 17:22 by msapiro.

Messages (1)
msg350214 - (view) Author: Mark Sapiro (msapiro) * (Python triager) Date: 2019-08-22 17:22
This is really due to an nntp server bug, but here's the scenerio.

A connection is opened to the server.

An article is posted via the connection's post() method.

The server responds to the article data with

240 Article posted <value of message-id>

but due to the server bug, if the message-id is long, this response comes on two lines as

240 Article posted
 <value of message-id>

The post() method reads only the first line and returns it.

Then the connection's quit() method (or some other method) is called, and it sees the second line of the prior response as the server's response rather than the actual response, and raises NNTPProtocolError.

Arguably, NNTPProtocolError is appropriate in this scenario, but if so, it should be raised by the post() method and not by a subsequent method.
History
Date User Action Args
2019-08-22 17:22:32msapirocreate