Xavier de Gaye added the comment:

When the server sends a line longer than _MAXLINE, nntplib reads only _MAXLINE 
+ 1 bytes leaving the remaining bytes left to be processed by the next command 
that will interpret those bytes as a protocol error. Hence the failing tests 
that follow the first NNTPDataError exception in the failing test_nntplib.

The patch increases _MAXLINE from 2048 to 4096 and fixes the above problem. It 
also takes care to read up to (and including) the terminator so that the 
following lines or the terminator is not interpreted as a protocol error by the 
next nntp command.

The patch does not include a test case.

----------
keywords: +patch
stage:  -> patch review
title: nntplib fails on all buildbots -> nntplib is broken when responses are 
longer than _MAXLINE
versions: +Python 2.7
Added file: http://bugs.python.org/file45901/nntplib_maxline.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28971>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to