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 cben
Recipients MLModel, cben, gpolo, kbk
Date 2010-03-16.20:15:06
SpamBayes Score 1.5043522e-14
Marked as misclassified No
Message-id <1268770511.64.0.790679455484.issue5233@psf.upfronthosting.co.za>
In-reply-to
Content
Oops!  Mitchell's patch didn't actually run the startup code after restart.  Fixed patch attached (updated against 2.7 trunk).  Also added some doc updates.  Too lazy to produce a 3.2 version now.

[Apology to Mitchell: I removed most of your comments explaining the change and attributing it to you.  Nothing personal, just that's we have version control to store that info.]

Open questions / doubts:

* I described it in Lib/idlelib/NEWS.txt - correct?

* There is much duplication between the Doc/library/idle.rst, the command-line help string in PyShell.py and the option parsing code.  Maybe it should be rewritten with optparse?  [Doesn't block this patch.]

* There is much duplication between begin()/start_subprocess() and restart_subprocess().  These pieces of the code have a history of being fragile, and having subtle differences between them is a bad idea :-(  I didn't dare refactor them as I can't test such changes widely enough, so the startup call is duplicated.

* When a script is being run, should the startup file run before or after it (or at all)?  Currently it runs before the script, which is good because it can e.g. set the excepthook, and bad because it's different from running in a clean Python.   (Python doesn't run PYTHONSTARTUP at all when running a script, even in -i mode.)
Opinions?  Anyway, it's hard to implement otherwise with currect runcode().

[Unrelated to the patch but bothering me: it seems that runcode() sometimes restart the shell and sometimes not, and is used in both capacities?!  This is very confusing.  Or am I just reading it wrong?]
History
Date User Action Args
2010-03-16 20:15:11cbensetrecipients: + cben, kbk, gpolo, MLModel
2010-03-16 20:15:11cbensetmessageid: <1268770511.64.0.790679455484.issue5233@psf.upfronthosting.co.za>
2010-03-16 20:15:09cbenlinkissue5233 messages
2010-03-16 20:15:09cbencreate