Index: Lib/io.py =================================================================== --- Lib/io.py (revision 68142) +++ Lib/io.py (working copy) @@ -1692,7 +1692,9 @@ self._snapshot = None # Restore the decoder to its state from the safe start point. - if self._decoder or dec_flags or chars_to_skip: + if cookie == 0 and self._decoder: + self._decoder.reset() + elif self._decoder or dec_flags or chars_to_skip: self._decoder = self._decoder or self._get_decoder() self._decoder.setstate((b'', dec_flags)) self._snapshot = (dec_flags, b'') Index: Lib/test/test_io.py =================================================================== --- Lib/test/test_io.py (revision 68142) +++ Lib/test/test_io.py (working copy) @@ -1080,6 +1080,8 @@ f.write(data) f.seek(0) self.assertEquals(f.read(), data * 2) + f.seek(0) + self.assertEquals(f.read(), data * 2) self.assertEquals(buf.getvalue(), (data * 2).encode(encoding)) def timingTest(self):