STINNER Victor <victor.stin...@haypocalc.com> added the comment: > The correct fix is to use tokenize.detect_encoding, > if anyone wants to provide a patch.
done :-) Attached patch opens the file in binary mode to call tokenize.detect_encoding() and then use the encoding to open the file a second time (in text (unicode) mode). ---------- nosy: +haypo Added file: http://bugs.python.org/file17422/tabnanny_detect_encoding.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8774> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com