Cherniavsky Beni <c...@users.sf.net> added the comment:

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?]

----------
nosy: +cben
Added file: http://bugs.python.org/file16564/startup-2.7.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5233>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to