Reset internal buffers when seek() is called. This fixes SF bug #1156259.

This commit is contained in:
Walter Dörwald 2005-03-14 19:06:30 +00:00
parent 3390d33dd7
commit 729c31f5c3
3 changed files with 33 additions and 1 deletions

View file

@ -356,7 +356,17 @@ class StreamReader(Codec):
from decoding errors.
"""
pass
self.bytebuffer = ""
self.charbuffer = u""
self.atcr = False
def seek(self, offset, whence):
""" Set the input stream's current position.
Resets the codec buffers used for keeping state.
"""
self.reset()
self.stream.seek(offset, whence)
def next(self):