mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Reset internal buffers when seek() is called. This fixes SF bug #1156259.
This commit is contained in:
parent
3390d33dd7
commit
729c31f5c3
3 changed files with 33 additions and 1 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue