This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients terry.reedy
Date 2018-03-02.17:52:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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/'.

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).
Date User Action Args
2018-03-02 17:52:55terry.reedysetrecipients: + terry.reedy
2018-03-02 17:52:55terry.reedysetmessageid: <>
2018-03-02 17:52:55terry.reedylinkissue32984 messages
2018-03-02 17:52:55terry.reedycreate