[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 61aaec67b521 by Victor Stinner in branch 'default': Close #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls http://hg.python.org/cpython/rev/61aaec67b521 -- nosy: +python-dev resolution: -> fixed stage: -> committed/

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-26 Thread Walter Dörwald
Walter Dörwald added the comment: +1 on the documentation changes. -- nosy: +doerwalter ___ Python tracker ___ ___ Python-bugs-list m

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread STINNER Victor
STINNER Victor added the comment: > I'm not sure what you mean by "discard the output". > > Calling .reset() should still add the closing sequence to the output > buffer, if needed. Incremental encoders don't have any buffer. Python 3.3a0 (default:3c7792ec4547+, May 26 2011, 00:24:51) >>> im

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > Le mercredi 25 mai 2011 à 08:23 +, Marc-Andre Lemburg a écrit : >>> Do we need an additional method? It seems that this reset() could >>> also be written encoder.encode('', final=True) >>

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread Martin
Martin added the comment: New cjk_encreset.patch looks good to me. As with issue 12100 this likely wasn't reported before because decoders are robust against escape sequence oddities. -- ___ Python tracker _

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread STINNER Victor
STINNER Victor added the comment: cjk_encreset.patch: Fix multibytecodec.MultibyteIncrementalEncoder.reset(), call encreset() instead of decreset(). Improve also incremental encoder tests: reset the encoder using .encode('', final=True) and check the output. I also prefer to reuse the existin

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread STINNER Victor
STINNER Victor added the comment: Le mercredi 25 mai 2011 à 08:23 +, Marc-Andre Lemburg a écrit : > > Do we need an additional method? It seems that this reset() could > > also be written encoder.encode('', final=True) > > +1 > > I think that's a much more natural way to implement "finaliz

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Amaury Forgeot d'Arc wrote: > > Amaury Forgeot d'Arc added the comment: > > Do we need an additional method? It seems that this reset() could also be > written encoder.encode('', final=True) +1 I think that's a much more natural way to implement "final

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Do we need an additional method? It seems that this reset() could also be written encoder.encode('', final=True) -- nosy: +amaury.forgeotdarc ___ Python tracker ___

[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-24 Thread STINNER Victor
New submission from STINNER Victor : HZ and ISO-2022 family codecs may generate an escape sequence at the end of a stream. For example, the HZ codec uses '~{' to switchs from ASCII to GB2312, and '~}' resets the encoding to ASCII. At the end of a stream, the encoding should be reset to ASCII.