Serhiy Storchaka added the comment:

Interesting, this doesn't work with non-UTF-8 locale.

$ touch astralš¯”¼.py
$ LC_ALL=en_US.iso88591 ./python -m idlelib.idle -e astralš¯”¼.py
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/serhiy/py/cpython/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/serhiy/py/cpython/Lib/idlelib/idle.py", line 11, in <module>
    idlelib.PyShell.main()
  File "/home/serhiy/py/cpython/Lib/idlelib/PyShell.py", line 1553, in main
    if flist.open(filename) is None:
  File "/home/serhiy/py/cpython/Lib/idlelib/FileList.py", line 36, in open
    edit = self.EditorWindow(self, filename, key)
  File "/home/serhiy/py/cpython/Lib/idlelib/PyShell.py", line 123, in __init__
    EditorWindow.__init__(self, *args)
  File "/home/serhiy/py/cpython/Lib/idlelib/EditorWindow.py", line 288, in 
__init__
    if io.loadfile(filename):
  File "/home/serhiy/py/cpython/Lib/idlelib/IOBinding.py", line 244, in loadfile
    self.updaterecentfileslist(filename)
  File "/home/serhiy/py/cpython/Lib/idlelib/IOBinding.py", line 525, in 
updaterecentfileslist
    self.editwin.update_recent_files_list(filename)
  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)

----------
nosy: +serhiy.storchaka

_______________________________________
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

Reply via email to