summaryrefslogtreecommitdiffstats
path: root/Lib/encodings
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2005-03-14 19:06:30 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2005-03-14 19:06:30 (GMT)
commit729c31f5c3e8dcbff571e066ab253db272e490a5 (patch)
tree1c9434e6f1411665bd3a0210cea4c64be87a89d3 /Lib/encodings
parent3390d33dd7d1fe4ce08a90f3a7f8759dfa101387 (diff)
downloadcpython-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/encodings')
-rw-r--r--Lib/encodings/utf_16.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/encodings/utf_16.py b/Lib/encodings/utf_16.py
index a33581c..95abb05 100644
--- a/Lib/encodings/utf_16.py
+++ b/Lib/encodings/utf_16.py
@@ -31,6 +31,13 @@ class StreamWriter(codecs.StreamWriter):
class StreamReader(codecs.StreamReader):
+ def reset(self):
+ codecs.StreamReader.reset(self)
+ try:
+ del self.decode
+ except AttributeError:
+ pass
+
def decode(self, input, errors='strict'):
(object, consumed, byteorder) = \
codecs.utf_16_ex_decode(input, errors, 0, False)