Terry J. Reedy <tjre...@udel.edu> added the comment:

When the IDLE GUI process is started, its main.__file__ is set to the idlelib 
.py file used to start the process.  If IDLE is started with -n, so that user 
code is run in the same process (the original mode), the -r or -s startup file 
and code entered at >>> sees this value*, rather than the user startup file 
name or a NameError.

* I am not sure why it does not see the value of __file__ in the pyshell 
module, which I would expect to be '.../idlelib/pyshell.py'.

The change proposed above would fix __file__ for -n also, but would disable any 
subsequently executed idle code that uses __file__ that gets unset.  So I think 
the wrapping should be conditioned on use_subprocess (True unless -n).


Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list

Reply via email to