Wrong package for Idle-python2.7?

Posted by adelval on Ask Ubuntu See other posts from Ask Ubuntu or by adelval
Published on 2013-11-09T08:40:22Z Indexed on 2013/11/09 10:15 UTC
Read the original article Hit count: 295

Filed under:
|

I'm running python 2.7 in Ubuntu 3.10, and idle (idle-python2.7) has stopped working. Whenever I try to open a file in a editor window, it is blank, though the file does exist and is not empty/blank. Furthermore, it is not possible to close idle after this, except via a terminal kill command.

  • Idle was working fine before. The problem appeared after I installed a number of things, including idlex, various scipy modules and mpmath, but after trying to repair it in several ways, it seems to be caused by Ubuntu's official idle package.

I get this error in the terminal when trying to open a file in idle:

Exception in Tkinter callback
[...lines ommitted for brevity...]
File "/usr/lib/python2.7/idlelib/IOBinding.py", line 129, in coding_spec
    for line in lst:
NameError: global name 'lst' is not defined

If you look at the code, it looks like an obvious bug: indeed lst is not defined in the function coding_spec. Furthermore, the source file IOBinding.py in http://fossies.org/dox/Python-2.7.5/IOBinding_8py_source.html is different and doesn't show the problem.

Thinking that one of the recently packages had overwritten the file somehow, I've tried a number of things, including reinstalling all Python packages from synaptic, but the wrong IOBinding.py is still there. The reason I think the problem lies with the package itself is that I finally did sudo apt-get remove idle, verified that the idlelib directory was empty, and reinstalled with sudo apt-get install idle; but the wrong IOBinding.py file came back again.

I can in fact make idle work again by simply replacing lst by str in the code, but to me that's clearly a no-no. I'm not to happy either about trying to replace just that file from the source python distribution, as other files may be wrong. I want to get the right files from the official package.

© Ask Ubuntu or respective owner

Related posts about python

Related posts about idle