Message117910
> 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:30 | pitrou | set | recipients:
+ pitrou, barry, r.david.murray, BreamoreBoy |
2010-10-03 13:04:30 | pitrou | set | messageid: <1286111070.01.0.517010440861.issue6302@psf.upfronthosting.co.za> |
2010-10-03 13:04:28 | pitrou | link | issue6302 messages |
2010-10-03 13:04:27 | pitrou | create | |
|