Message153354
| Author |
Jim.Jewett |
| Recipients |
Jim.Jewett, ezio.melotti |
| Date |
2012年02月14日.18:01:52 |
| SpamBayes Score |
1.0754355e-06 |
| Marked as misclassified |
No |
| Message-id |
<1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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() |
|
History
|
|---|
| 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 |
|