Antoine Pitrou <pit...@free.fr> added the comment: Well, there are other problems with utf-16, e.g. when opening an existing file for appending, the BOM is written again:
>>> f = open('utf16.txt', 'w', encoding='utf-16') >>> f.write('abc') 3 >>> f.close() >>> f = open('utf16.txt', 'a', encoding='utf-16') >>> f.write('def') 3 >>> f.close() >>> open('utf16.txt', 'r', encoding='utf-16').read() 'abc\ufeffdef' Who said TextIOWrapper was sane? :-o ---------- nosy: +pitrou _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4862> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com