[Python-bugs-list] [Bug #110618] IDLE: Modifying argv prevents source of ~/.idle.py (PR#219)

noreply@sourceforge.net noreply@sourceforge.net
Thu, 7 Sep 2000 15:05:10 -0700


Bug #110618, was updated on 2000-Jul-31 14:06
Here is a current snapshot of the bug.

Project: Python
Category: IDLE
Status: Open
Resolution: None
Bug Group: None
Priority: 3
Summary: IDLE: Modifying argv prevents source of ~/.idle.py (PR#219)

Details: Jitterbug-Id: 219
Submitted-By: aa8vb@yahoo.com
Date: Mon, 28 Feb 2000 07:49:55 -0500 (EST)
Version: 1.5.2
OS: IRIX 6.5.6f


(Two problems leading up to allowing IDLE to read color settings from
~/.idle.py.
They're separate problems so I'll put each in separate bug reports.)

As Bernhard Herzog recently pointed out, Tkinter apps try to load
.<classname>.tcl, .<classname>.py, .<appname>.tcl and .<appname>.py out of a
user's home directory, if present.  <classname> defaults to "Tk" and <appname>
defaults to the base of argv[0] (e.g. "idle").

With these reasonable defaults, one would expect they could create a ~/.idle.py
which IDLE would read for configuration info.  However, Tkinter "won't" try
to read ~/.idle.py unless -e is specified.  This is because IDLE is
hacking up sys.argv for some reason when -e isn't specified, which results in
sys.argv[0] being empty, which prevents baseName from being set, which 
in turn causes Tkinter to look for these files:

   ~/.Tk.tcl ~/.Tk.py ~/..tcl ~/..py

instead of:

   ~/.Tk.tcl ~/.Tk.py ~/.idle.tcl ~/.idle.py

Seeing this, I verified that IDLE does indeed read ~/.idle.py when invoked
as "idle.py -e".

This appears to be a bug.  If so, please update IDLE so that argv[0] is
left unadulterated at least until Tkinter is initialized, so that it can
read ~/.<basename>.py for configuration.

Also, it might be worthwhile to set the className (argument to Tk()) to
"Idle" or "IDLE" so an IDLE configuration file can be created which will 
be executed independent of what the idle script itself is named.




====================================================================
Audit trail:
Tue Mar 07 14:38:27 2000	guido	changed notes
Tue Mar 07 14:38:27 2000	guido	changed notification
Tue Mar 07 14:38:27 2000	guido	moved from incoming to open

Follow-Ups:

Date: 2000-Sep-07 15:05
By: jhylton

Comment:
Please do triage on this bug.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110618&group_id=5470