diff options
author | Walter Dörwald <walter@livinglogic.de> | 2005-03-14 19:06:30 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2005-03-14 19:06:30 (GMT) |
commit | 729c31f5c3e8dcbff571e066ab253db272e490a5 (patch) | |
tree | 1c9434e6f1411665bd3a0210cea4c64be87a89d3 /Lib/codecs.py | |
parent | 3390d33dd7d1fe4ce08a90f3a7f8759dfa101387 (diff) | |
download | cpython-729c31f5c3e8dcbff571e066ab253db272e490a5.zip cpython-729c31f5c3e8dcbff571e066ab253db272e490a5.tar.gz cpython-729c31f5c3e8dcbff571e066ab253db272e490a5.tar.bz2 |
Reset internal buffers when seek() is called. This fixes SF bug #1156259.
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r-- | Lib/codecs.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py index b4103fb..092da0c 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -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): |