[issue20132] Many incremental codecs don’t handle fragmented data

2016-08-19 Thread Martin Panter
Martin Panter added the comment: Split off Issue 27799 for the base-64 incremental decoder -- dependencies: +Fix base64-codec and bz2-codec incremental decoders ___ Python tracker

[issue20132] Many incremental codecs don’t handle fragmented data

2015-07-22 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- dependencies: +Fix codecs.iterencode/decode() by allowing data parameter to be omitted, Stream encoder for zlib_codec doesn't use the incremental encoder, quopri module differences in quoted-printable text with whitespace,

[issue20132] Many incremental codecs don’t handle fragmented data

2015-03-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka stage: - patch review versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20132 ___

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-24 Thread Martin Panter
Martin Panter added the comment: Here is a new patch which fixes the bytes-to-bytes incremental codecs. It depends on my patches for these other issues being applied first: * Issue 23231: Bytes-to-bytes support for iteren/decode() * Issue 13881: Generic StreamWriter from IncrementalEncoder *

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-16 Thread Martin Panter
Martin Panter added the comment: There is a flaw with inheriting the readline() method in my patch, and I have decided to give up fixing the StreamReader classes. I did update the documentation in my copy of the patch based on Marc-Andre Lemburg’s feedback if anyone is interested in it,

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-15 Thread Martin Panter
Martin Panter added the comment: I opened Issue 23231 about fixing iterencode() and iterdecode() in the general case. I added a patch to Issue 13881 to fix StreamWriter for zlib and bz2, and to fix StreamWriter.writelines() in general. I am adding a patch here to clarify the StreamReader API

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-15 Thread Martin Panter
Martin Panter added the comment: My “master plan” is basically to make most of the bytes-to-bytes codecs work as documented in the incremental (stateful) modes. I’m less interested in fixing the text codecs, and the quopri and uu codecs might be too hard, so I was going to propose some

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 15.01.2015 23:46, Martin Panter wrote: I opened Issue 23231 about fixing iterencode() and iterdecode() in the general case. I added a patch to Issue 13881 to fix StreamWriter for zlib and bz2, and to fix StreamWriter.writelines() in general. I

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: This addition is wrong as well: The *stream* argument must be a file-like object open for reading - text or binary data, as appropriate for the specific codec. + text or binary data, as appropriate for the specific codec. This stream is + assumed

[issue20132] Many incremental codecs don’t handle fragmented data

2014-12-17 Thread Martin Panter
Martin Panter added the comment: The “unicode-escape” and “utf-7” cases affect the more widely-used TextIOWrapper interface: TextIOWrapper(BytesIO(br\u2013 * 2000), unicode-escape).read(1) Traceback (most recent call last): File stdin, line 1, in module File

[issue20132] Many incremental codecs don’t handle fragmented data

2014-09-09 Thread Martin Panter
Martin Panter added the comment: Stream reader interfaces suffer the same problem. Test cases: codecs.getreader(unicode-escape)(BytesIO(br\u2013)).read(1) codecs.getreader(hex-codec)(BytesIO(b33)).read(1) codecs.getreader(base64-codec)(BytesIO(bAA==)).read(1) TestCase().assertEqual(b=,

[issue20132] Many incremental codecs don’t handle fragmented data

2014-01-10 Thread Walter Dörwald
Walter Dörwald added the comment: 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

[issue20132] Many incremental codecs don’t handle fragmented data

2014-01-10 Thread Martin Panter
Martin Panter added the comment: I think calling iterencode() with an empty iterator is a side issue. Even with a non-empty iterator, it tries to encode an empty _text_ string to finalise the encoder: bytes().join(codecs.iterencode(iter((bdata,)), base64-codec)) Traceback (most recent call

[issue20132] Many incremental codecs don’t handle fragmented data

2014-01-05 Thread Martin Panter
New submission from Martin Panter: Many of the incremental codecs do not handle fragmented data very well. In the past I think I was interested in using the Base-64 and Quoted-printable codecs, and playing with other codecs today reveals many more issues. A lot of the issues reflect missing

[issue20132] Many incremental codecs don’t handle fragmented data

2014-01-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +doerwalter, haypo, lemburg, loewis, ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20132 ___