mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)
This commit is contained in:
parent
aac4d0342c
commit
a6ec1ce1ac
3 changed files with 33 additions and 0 deletions
|
@ -847,6 +847,12 @@ class StreamRecoder:
|
|||
self.reader.reset()
|
||||
self.writer.reset()
|
||||
|
||||
def seek(self, offset, whence=0):
|
||||
# Seeks must be propagated to both the readers and writers
|
||||
# as they might need to reset their internal buffers.
|
||||
self.reader.seek(offset, whence)
|
||||
self.writer.seek(offset, whence)
|
||||
|
||||
def __getattr__(self, name,
|
||||
getattr=getattr):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue