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.

Author Jim.Jewett
Recipients BreamoreBoy, Jim.Jewett, ezio.melotti, martin.panter, vstinner
Date 2015-01-14.01:37:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CA+OGgf7A91OzG7Edq5F4ODukQxNxYOS0kxq2jiRzG66+pnLT8A@mail.gmail.com>
In-reply-to <1421198478.4.0.622374085396.issue14014@psf.upfronthosting.co.za>
Content
That sounds like a bug magnet to me; my mental model is that the codec
is my output; flushing it will push things out, and resetting it will
erase anything pending.  I don't care if some implementation detail
means that some other object technically owns the buffer.

An alternative (inferior, but better than nothing) would be to add an
explicit note warning users that reset won't really finish the job,
and they have to also get the codec's underlying stream and flush
that.  (Of course, if the stream is really an abstraction over the
real stream ... at what point does the delegation start to work on its
own?)

On Tue, Jan 13, 2015 at 8:21 PM, Martin Panter <report@bugs.python.org> wrote:
>
> Martin Panter added the comment:
>
> I don’t think this is appropriate. If you want to flush the underlying stream, then call its flush() method after calling reset(). The docstring only says it flushes the _codec’s_ buffers, not any buffers of the underlying stream, and it should not be the codec’s business to worry about lower level buffers.
>
> ----------
> nosy: +vadmium
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue14014>
> _______________________________________
History
Date User Action Args
2015-01-14 01:37:24Jim.Jewettsetrecipients: + Jim.Jewett, vstinner, ezio.melotti, BreamoreBoy, martin.panter
2015-01-14 01:37:23Jim.Jewettlinkissue14014 messages
2015-01-14 01:37:22Jim.Jewettcreate