Message153354
def reset(self):
""" Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state.
"""
pass
This does not ensure that the stream is flushed, as the docstring promises. I believe the following would work better.
def reset(self):
""" Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state.
"""
if hasattr(self.stream, "flush"): self.stream.flush() |
|
Date |
User |
Action |
Args |
2012-02-14 18:01:53 | Jim.Jewett | set | recipients:
+ Jim.Jewett, ezio.melotti |
2012-02-14 18:01:53 | Jim.Jewett | set | messageid: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> |
2012-02-14 18:01:53 | Jim.Jewett | link | issue14014 messages |
2012-02-14 18:01:52 | Jim.Jewett | create | |
|