Message248700
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. |
|
Date |
User |
Action |
Args |
2015-08-17 01:08:24 | terry.reedy | set | recipients:
+ terry.reedy, roger.serwy, python-dev, serhiy.storchaka, kamisky, sanad |
2015-08-17 01:08:23 | terry.reedy | set | messageid: <1439773703.93.0.0434809687548.issue23672@psf.upfronthosting.co.za> |
2015-08-17 01:08:23 | terry.reedy | link | issue23672 messages |
2015-08-17 01:08:22 | terry.reedy | create | |
|