[issue8774] tabnanny improperly handles non-ascii source files

STINNER Victor report at bugs.python.org
Fri May 21 00:33:20 CEST 2010


STINNER Victor <victor.stinner at 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 <report at bugs.python.org>
<http://bugs.python.org/issue8774>
_______________________________________


More information about the Python-bugs-list mailing list