This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients naguilera, ned.deily
Date 2011-01-22.07:45:38
SpamBayes Score 1.31368e-11
Marked as misclassified No
Message-id <>
From the traceback, IDLE is crashing on a decode error when trying to process the list of recently used files which is used to populate its recent files menu.  That list of files is saved in ~/.idlerc/recent-file.lst so an easy workaround is to delete the file before launching  IDLE appears to be dependent on locale LANG settings.  When launched by double-clicking, like all Mac GUI apps does not inherited environment variables set in shell profiles, as in a terminal session.  The problem can be easily reproduced with bin/idle which is started from a shell environment:

$ echo $LANG
$ echo "/Users/nad/Documents/test_ä.py" > ~/.idlerc/recent-files.lst
nad@fimt:~$ /usr/local/bin/idle3.2
# idle starts normally with the umlauted file name in the recent files menu
$ unset LANG
$ /usr/local/bin/idle3.2
Traceback (most recent call last):
  File "/usr/local/bin/idle3.2", line 5, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 1388, in main
    shell = flist.open_shell()
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 277, in open_shell
    self.pyshell = PyShell(self)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 813, in __init__
    OutputWindow.__init__(self, flist, None, None)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 16, in __init__
    EditorWindow.__init__(self, *args)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 267, in __init__
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 777, in update_recent_files_list
    rf_list = rf_list_file.readlines()
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/encodings/", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128)

A similar exception occurs (without a crash) when saving a file to a non-ASCII file name and LANG is not properly set:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/tkinter/", line 1399, in __call__
    return self.func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 166, in handler
    r = l[i](event)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 328, in save
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 350, in save_as
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 515, in updaterecentfileslist
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/", line 795, in update_recent_files_list
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 16: ordinal not in range(128)
Date User Action Args
2011-01-22 07:50:11ned.deilyunlinkissue10974 messages
2011-01-22 07:45:42ned.deilysetrecipients: + ned.deily, naguilera
2011-01-22 07:45:42ned.deilysetmessageid: <>
2011-01-22 07:45:39ned.deilylinkissue10974 messages
2011-01-22 07:45:38ned.deilycreate