Author: amaury.forgeotdarc
Date: Mon Nov 19 22:14:47 2007
New Revision: 59061
Modified:
python/branches/py3k/Lib/io.py
Log:
Oops, I missed this one again (test_univnewlines fails):
Some incremental decoders return multiple characters, even when fed with
only one more byte. In this case the tell() state must subtract the
number of extra characters.
Modified: python/branches/py3k/Lib/io.py
==============================================================================
--- python/branches/py3k/Lib/io.py (original)
+++ python/branches/py3k/Lib/io.py Mon Nov 19 22:14:47 2007
@@ -1283,7 +1283,7 @@
decoder_buffer, decoder_state = decoder.getstate()
return self._encode_decoder_state(
decoder_state,
- position + (i+1) - len(decoder_buffer))
+ position + (i+1) - len(decoder_buffer) - (n - needed))
raise IOError("Can't reconstruct logical file position")
finally:
decoder.setstate(saved_state)
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins