[issue10335] tokenize.open_python(): open a Python file with the right encoding
report at bugs.python.org
Sat Nov 6 17:25:33 CET 2010
Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:
On Sat, Nov 6, 2010 at 12:15 PM, Éric Araujo <report at bugs.python.org> wrote:
>> so "tokenize.open()" sounds attractive.
> Agreed, even though the docstring of tokenize does talk about Python code.
I still like "tokenize.open()" more, but for the sake of completeness
of discussion, what about open(.., encoding="fromcookie")? (I know,
tokenize.detect_encoding() also looks for an utf-8 BOM, so
"fromcookie" can be improved.)
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list