Amaury Forgeot d'Arc added the comment: I have a similar issue with a directory '∫' ('\u222b') containing a file foo.py:
>>> sys.path.insert(0, '\u222b') >>> import foo Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<frozen importlib._bootstrap>", line 1564, in _find_and_load File "<frozen importlib._bootstrap>", line 1531, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper File "<frozen importlib._bootstrap>", line 1023, in load_module File "<frozen importlib._bootstrap>", line 1004, in load_module File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper File "<frozen importlib._bootstrap>", line 854, in _load_module File "<frozen importlib._bootstrap>", line 981, in get_code File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character (I got this traceback with "python -v") line 981 contains a call to compile(). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17588> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com