[Python-bugs-list] PRIVATE: IDLE bug (PR#297)
ovi@physics.utoronto.ca
ovi@physics.utoronto.ca
Sat, 15 Apr 2000 15:57:02 -0400 (EDT)
Full_Name: Ovidiu Toader
Version: Python 1.6a2 (#15, Apr 7 2000, 21:14:35)
OS: Linux alpha
Submission from: phoenix.physics.utoronto.ca (128.100.78.35)
This is an IDLE related problem:
phoenix:Work> idle
/usr/local/Packages/lang/python/install/../python/dist/src/Tools/idle/idle.py
Traceback (most recent call last):
File "/usr/local/bin/idle", line 17, in ?
PyShell.main()
...... cut ....
File "/usr/local/Packages/lang/python/install/lib/python1.6/ConfigParser.py",
line 243, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: EditorWindow
The problem is caused by the fact that idle.py assumes the configuration files
to be located in the directory where the executable is found.
I do not think that having a link from /usr/local/bin/idle to /path/to/idle.py
is uncommon on unix. The following patch fixes this small problem. The patch is
against the latest CVS sources.
-------------------------------------------------------------------------------
I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims"). To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part
of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.
I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.
Index: idle.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Tools/idle/idle.py,v
retrieving revision 1.2
diff -c -r1.2 idle.py
*** idle.py 2000/03/03 23:06:45 1.2
--- idle.py 2000/04/15 19:35:51
***************
*** 4,10 ****
import sys
import IdleConf
! idle_dir = os.path.split(sys.argv[0])[0]
IdleConf.load(idle_dir)
# defer importing Pyshell until IdleConf is loaded
--- 4,14 ----
import sys
import IdleConf
! exe_path = sys.argv[0]
! while os.path.islink(exe_path):
! exe_path = os.readlink(exe_path)
!
! idle_dir = os.path.split(exe_path)[0]
IdleConf.load(idle_dir)
# defer importing Pyshell until IdleConf is loaded