[issue19613] test_nntplib: sporadic failures, test_article_head_body()

Martin Panter report at bugs.python.org
Tue Jul 26 23:17:04 EDT 2016


Martin Panter added the comment:

I played with the server and group that is apparently used in the test:

>>> server = NNTP_SSL("nntp.aioe.org")
>>> [_, _, first, last, _] = server.group("fr.comp.lang.python")
>>> first
2900
>>> last
2915
>>> server.body(last)[1].lines[-1]
b''
>>> server.body(first)[1].lines[-1]
b'Merci'
>>> server.body(last - 1)[1].lines[-1]
b'Kevin'

I tried all articles from 2900–2915, and none of them end with a dot on its own line, so I don’t actually know what caused the failure.

However looking again at the _getlongresp() implementation, I cannot imagine how the test failure can occur except for a genuine body that ends with a dot on its own line (encoded as b".." and then converted to b"."). Here is a quick patch to alter the test cases.

----------
keywords: +patch
stage: needs patch -> patch review
versions:  -Python 3.4
Added file: http://bugs.python.org/file43903/ending-dot.patch

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


More information about the Python-bugs-list mailing list