[issue5006] Duplicate UTF-16 BOM if a file is open in append mode

Antoine Pitrou report at bugs.python.org
Thu Mar 26 18:41:35 CET 2009


Antoine Pitrou <pitrou at free.fr> added the comment:

Le jeudi 26 mars 2009 à 17:26 +0000, STINNER Victor a écrit :
> STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> 
> > - I'm not sure why you make self->ok handling more complicated than it was
> 
> tell() requires self->ok=1. I choosed to reset self->ok to zero on error, but 
> it's maybe useless.

You are calling tell() on the underlying binary buffer, not on the
TextIOWrapper object. So self->ok should have no impact. Am I missing
something?

> self>encodefunc value have to be changed because <encoder>.setstate() changes 
> the encoding function: UTF-16 => UTF-16-LE or UTF-16-BE.

I know, but then the logic should probably be changed and use an
additional struct member to signal that the start of file has been
skipped.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5006>
_______________________________________


More information about the Python-bugs-list mailing list