[issue10284] Exception raised when decoding NNTP newsgroup descriptions

Julien ÉLIE report at bugs.python.org
Tue Nov 2 23:06:10 CET 2010

Julien ÉLIE <julien at trigofacile.com> added the comment:

David, the headers are not at all supposed to be "utf-8" encoded.
For instance, have a look at the cn.bbs.comp.lang.python newsgroup:


If you look at the source of the articles, you will for instance see that the Subject: header field is not MIME-encoded.  It is directly written in gb2312.

That's how news works in the wild.  Please do not break nntplib in Python 3.2!

Regarding AUTHINFO, the specification is not broken at all.  Bytes are expected, not strings in a particular encoding.  Well, most people are in fact confused when they speak about encodings -- me included :-)
The specification is pretty clear:  NNTP expects bytes.  And my text string is "\xC9ric", that's all.  Please also do not break nntplib when providing such strings on class instantiation.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list