Author terry.reedy
Recipients terry.reedy
Date 2018-03-02.17:52:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520013175.05.0.467229070634.issue32984@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2018-03-02 17:52:55terry.reedysetrecipients: + terry.reedy
2018-03-02 17:52:55terry.reedysetmessageid: <1520013175.05.0.467229070634.issue32984@psf.upfronthosting.co.za>
2018-03-02 17:52:55terry.reedylinkissue32984 messages
2018-03-02 17:52:55terry.reedycreate