STINNER Victor <[email protected]> added the comment:
@pitrou: You're right, but the state have to be changed for the
encoder, not the decoder. I added the following code to TextIOWrapper
constructor (for the C and the Python version of io library):
if self._seekable and self.writable():
position = self.buffer.tell()
if position != 0:
self._encoder = self._get_encoder()
self._encoder.setstate(0)
----------
keywords: +patch
Added file: http://bugs.python.org/file13377/append_bom.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue5006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com