← 输入框|bugs.python.org|刷新

➜

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.

作者 doerwalter
收信人 doerwalter, lemburg, loewis, martin.panter, ncoghlan, vstinner
日期 2014-01-10.11:26:49
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1389353210.68.0.603563067958.issue20132@psf.upfronthosting.co.za>
In-reply-to
内容
The best solution IMHO would be to implement real incremental codecs for all of those.

Maybe iterencode() with an empty iterator should never call encode()? (But IMHO it would be better to document that iterencode()/iterdecode() should only be used with "real" codecs.)

Note that the comment before PyUnicode_DecodeUTF7Stateful() in unicodeobject.c reads:

/* The decoder.  The only state we preserve is our read position,
 * i.e. how many characters we have consumed.  So if we end in the
 * middle of a shift sequence we have to back off the read position
 * and the output to the beginning of the sequence, otherwise we lose
 * all the shift state (seen bits, number of bits seen, high
 * surrogate). */

Changing that would have to introduce a state object that the codec updates and from which it can be restarted.

Also the encoder does not buffer anything. To implement the suggested behaviour, the encoder might have to buffer unlimited data.
历史
日期 用户 动作 参数
2014-01-10 11:26:50doerwalter修改recipients: + doerwalter, lemburg, loewis, ncoghlan, vstinner, martin.panter
2014-01-10 11:26:50doerwalter修改messageid: <1389353210.68.0.603563067958.issue20132@psf.upfronthosting.co.za>
2014-01-10 11:26:50doerwalter链接issue20132 messages
2014-01-10 11:26:49doerwalter创建