[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

Andrew McNabb report at bugs.python.org
Tue Feb 14 19:43:09 CET 2012


Andrew McNabb <amcnabb at mcnabbs.org> added the comment:

It looks like encodings/zlib_codec.py defines a custom IncrementalEncoder and IncrementalDecoder, but its StreamWriter and StreamReader rely on the standard implementation of codecs.StreamWriter and codecs.StreamReader.

One solution might be to have zlib_codec.StreamWriter inherit from zlib_codec.IncrementalEncoder instead of from zlib_encoder.Codec. I'm not familiar enough with the codecs library to know whether this is the best approach.

Unfortunately, there are 120 codec files in the encodings directory, and it's unclear how many of them would need to be modified. Based on the number of them that implement StreamWriter as "class StreamWriter(Codec,codecs.StreamWriter)", it looks like it might be a lot of them. Was each of these 120 files hand-written?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13881>
_______________________________________


More information about the Python-bugs-list mailing list