Author terry.reedy
Recipients kamisky, python-dev, roger.serwy, sanad, serhiy.storchaka, terry.reedy
Date 2015-08-17.01:08:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439773703.93.0.0434809687548.issue23672@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-08-17 01:08:24terry.reedysetrecipients: + terry.reedy, roger.serwy, python-dev, serhiy.storchaka, kamisky, sanad
2015-08-17 01:08:23terry.reedysetmessageid: <1439773703.93.0.0434809687548.issue23672@psf.upfronthosting.co.za>
2015-08-17 01:08:23terry.reedylinkissue23672 messages
2015-08-17 01:08:22terry.reedycreate