This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients BreamoreBoy, barry, pitrou, r.david.murray
Date 2010-10-03.13:04:27
SpamBayes Score 7.3827e-08
Marked as misclassified No
Message-id <>
> I think nttplib's use case can be satisfied via the issue 4661 patch
> coupled with the decode_header bytes-recovery enhancement.

I don't really understand how that could.
nntplib needs to "decode" (in the decode_header sense) headers containing unescaped as well as escaped non-ASCII chars. Encoding with "ascii" clearly breaks the first use case.

Since the decode_header() API is so silly to begin with, I'd suggest providing another higher-level API instead. One which takes an str and returns another str (not bytes!) instead of that list of tuples.

If you really want to "fix" the current decode_header(), I'd recommend adding an optional "encoding" parameter so that nntplib can give utf-8 instead of ascii. nntplib and other consumers will still have to decode back in order to get an str, which makes the whole encoding thing a bit useless.

Oh, and instead of None, it would be nicer to give the actual encoding (e.g. "ascii"). It's no fun trying to guess.
Date User Action Args
2010-10-03 13:04:30pitrousetrecipients: + pitrou, barry, r.david.murray, BreamoreBoy
2010-10-03 13:04:30pitrousetmessageid: <>
2010-10-03 13:04:28pitroulinkissue6302 messages
2010-10-03 13:04:27pitroucreate