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