Terry J. Reedy added the comment: >From msg248192 (Serhiy - which ... > File "/home/serhiy/py/cpython/Lib/idlelib/EditorWindow.py", line 899, in > update_recent_files_list > if '\0' in path or not os.path.exists(path[0:-1]): > File "/home/serhiy/py/cpython/Lib/genericpath.py", line 19, in exists > os.stat(path) > UnicodeEncodeError: 'latin-1' codec can't encode character '\U0001d53c' in > position 22: ordinal not in range(256)
On Windows, os.stat(astralpath) raises FileNotFoundError: [WinError 2] The system cannot find the file specified: 'as\U00011111.py' and os.path.exists(astralpath) catches the exception and returns False. It is a linux issue, and perhaps a bug, that os.path.exists does not catch the exception. To me, as I read the docstring, it should always return True or False, with the latter the default, for any input string. The EditorWindow line is testing for 'badfiles' to be excluded from the recent files list. We can work around the linux behavior with try-except. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23672> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com