mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
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.
This commit is contained in:
parent
1ff9910f59
commit
a2d1d7e3b2
1 changed files with 1 additions and 1 deletions
|
@ -1283,7 +1283,7 @@ class TextIOWrapper(TextIOBase):
|
|||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue