Santoso Wijaya added the comment: I think you should use codecs.BOM_UTF8 rather than using hardcoded string "\xef\xbb\xbf" directly.
And why special casing UTF-8 while we're at it? What about other encodings and their BOMs? ---------- nosy: +santa4nt _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21509> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com