diff --git a/python-stdlib/tokenize/metadata.txt b/python-stdlib/tokenize/metadata.txt new file mode 100644 index 00000000..d0a9e89c --- /dev/null +++ b/python-stdlib/tokenize/metadata.txt @@ -0,0 +1,5 @@ +srctype = micropython-lib +type = module +version = 1.0 +author = Andrew Leech +long_desc = Minimal tokenize stub supporting open() in utf8 encoding. diff --git a/python-stdlib/tokenize/tokenize.py b/python-stdlib/tokenize/tokenize.py new file mode 100644 index 00000000..61510f99 --- /dev/null +++ b/python-stdlib/tokenize/tokenize.py @@ -0,0 +1,8 @@ +from builtins import open as _builtin_open + + +def open(filename): + """Open a file in read only text mode using utf8. + """ + return _builtin_open(filename, "r", encoding="utf8") +