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.

classification
Title: idlelib for Python 3 with Guilherme Polo GSoC enhancements
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: Bruce.Sherwood, Todd.Rovito, asvetlov, eric.araujo, kbk, ned.deily, pitrou, roger.serwy, terry.reedy, veky
Priority: normal Keywords: patch

Created on 2010-10-13 03:19 by Bruce.Sherwood, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
vidle20101012.diff Bruce.Sherwood, 2010-10-13 03:19 diff file between idlelib and enhancements
issue10079_rebased_for_py3k.patch ned.deily, 2010-10-14 05:29
idlelib20101012_from_r32a3.patch Bruce.Sherwood, 2010-10-17 23:09
idlelib2.7_from_release27-maint.patch Bruce.Sherwood, 2010-10-19 04:19 patch built from release27-maint branch review
Messages (17)
msg118501 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-10-13 03:19
It is proposed to incorporate the work of Guilherme Polo in the 2009
Google Summer of Code into idlelib. Polo's enhancements have been
extensively tested for a year through being included with VPython.

Here is a description from NEWS.txt:

In December 2008 David Scherer created an alternative version
of IDLE to fix some long-standing problems. In the 2009 Google
Summer of Code Guilherme Polo continued this work, assisted by
Bruce Sherwood. Important new fixes and features include:

 * A configuration preference that permits writing and running
   test programs from the editor without having to save the file
   (you're warned upon quitting whether to save).

 * Bringing the shell window forward in case of an error (because
   novices often failed to realize why their program had stopped).
 * A revert plug-in (FileRevert.py).

 * Unreliable and slow termination of user program on Windows;
   now you can re-run without first closing the graphics window.

 * Missing preferences and other menus on Macintosh.

 * Use any port for RPC server, so multiple instances of VIDLE
   can run at the same time without interference.

Polo submitted patches at the end of the summer of 2009, found at
code.google.com/p/google-summer-of-code-2009-python/downloads/list
This was for the Python 2.X series.

Because the mechanism was not clear for getting these patches
into the version of IDLE distributed with Python, the patched
version has been distributed with VPython (vpython.org) with
the name VIDLE to attempt to avoid confusion with IDLE. It is
installed into site-packages.

In October 2010 Bruce Sherwood manually applied Polo's patches
to the idlelib found at 
   svn.python.org/projects/python/tags/r312/Lib/idlelib 

In addition to applying Polo's patches, the new code uses the new
dot addressing of modules (e.g. from . import PyShell). Except for
having to change one absolute address in the use of __import__ in
PyShell.py, this version can work either in Python31/Lib/idlelib or
in Python31/Lib/site-packages/vidle. This VIDLE will be included in
the installer for VPython for Python 3.
msg118613 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-10-14 05:29
Thanks for creating the patch.  Since it is a feature, it would be considered to be applied to the current py3k branch (which at the moment is what will be going into the 3.2 release) rather than 3.1 which is generally only accepting bug fixes.

By the way, since I was investigating some other issues in IDLE for OS X, I thought it would be interesting to try the code here on the current 3.2. To that end, I did a quick forward port of the patch file, vidle20101012.diff, to the current py3k (3.2) branch.  The results are attached, but need to be thoroughly reviewed.  I simply did a quick test which indicated the patch did not have an impact one way or the other on the other issues so, at the moment, I am not planning to work further on this patch. I am uploading it here in case it might be of use.

Some notes: the 3.2 version of the patch differs because some of the changes in the original patch have already been checked in to py3k; there was another new file missing from the original patch (utils.py) which I pulled in from the vpython.org VIDLE 3.1.2 source patch, and I noticed one line in IOBinding.py that is commented out in the vidle20101012.diff file but not in the vpython.org source (I added a further comment there around line 240).
msg118618 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-10-14 06:14
Thanks for catching the missing utils.py file. I can explain the missing/commented statement in IOBinding.py. I found experimentally that if that statement is present, when you open a file on Windows the first line is off the top of the display, which can be quite confusing; this bug is not present on the Mac, and deleting the statement makes Windows work properly without affecting the Mac. The deletion of the statement was the very last correction Guilherme Polo made, and I got the correction into the patch I submitted but not into a less correct file at vpython.org.
msg118989 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-10-17 23:09
I found a couple of mistakes in the patch I submitted (places where "vidle" should have been "idlelib", and which aren't addressed in Ned Deily's patch), so I've rebuilt the patch starting from the tag r32a3, which I assume is the version from which Ned started.
msg119116 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2010-10-19 04:19
At Guido's request, I've carried out the same update to the IDLE distributed with Python 2.7 that I submitted for Python 3, to incorporate the work of Guilherme Polo in the Google Summer of Code 2009. Guido was concerned that with significant problems reported for IDLE 2.7, there should be an update despite Python 2.7 itself being essentially frozen. The basic structure for IDLE 3.2 was carried over. The main changes that had to be made to the Polo code were the change in module names between Python 2.7 and Python 3.2 (e.g. Tkinter in 2.7 is tkinter in 3.2). The patch was built from the release27-maint branch. Bug report 10137 should now be listed as a duplicate.
msg125228 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-03 20:17
Ping. IDLE dead again?
msg125247 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-01-03 21:49
Not dead, just pining for the fjords.  The two versions of the patch as submitted need some work before being ready for review. One issue is that the patches were originally applied to earlier snapshots of IDLE, so some subsequent changes have been reverted in the patches.  Also the patches contains a collection of mostly disparate features and changes: some appear to be straightforwardly compatible while other parts appeared to change existing behavior and may need to be discussed.  Rather than troubling Bruce again, I'd be happy to refresh them and perhaps split them up into more manageable pieces.  I'll try to find some time to do so in the near future.
msg125251 - (view) Author: Bruce Sherwood (Bruce.Sherwood) Date: 2011-01-03 23:36
Thanks for the reassurance, Ned. I would be happy to help, but frankly I don't know my way around in IDLE very well, and I pretty much tried simply to get Polo's changes into the hopper. Presumably if you want a view of the separate issues he addressed, you can get some guidance from his GSoC work.
msg149930 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2011-12-20 21:33
I went through the changes in "idlelib20101012_From_r32a3.patch". 

A lot of the changes are for using relative imports. Those changes aside, here is a list of issues that this patch covers. Most of these issues already have patches that are included in the large patch.

EditorWindow.py, textView.py:
    issue964437 - "idle help is modal"

EditorWindow.py, OutputWindow.py, PyShell.py:
    issue1207589 - "Right Click Context Menu"

ClassBrowser.py:
    patch in issue1612262 - "Class Browser doesn't show internal classes"

FileRevert.py:
    patch in issue1721083 - "Add File - Reload"

IOBinding.py:
    patch in issue6699 - "IDLE: Warn user about overwriting a file that has a newer version on filesystem"
    patch in issue4832 - "idle filename extension"

PyShell.py:
    - use "subprocess" module - already fixed in issue12540
    - patch for "paste_callback" in issue3359 - "Pasted \n not same as typed \n"
    - fix for issue6698 "IDLE no longer opens only an edit window when configured to do so"
 
    
There are two major changes that are not covered by other issues (AFAIK). 
1) The "PseudoStderrFile" in PyShell.py brings the shell forward if an error occurs. I like this behavior.
2) Run a script without saving it first. This functionality is scattered across several files.

There are several other small tweaks in the patch that will need some review. 

If I missed anything, please add a comment.
msg149931 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2011-12-20 21:35
minor mistake - issue3559 "Pasted \n not same as typed \n"
msg149932 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-12-20 22:14
Thanks, Roger.  It would also be helpful if you ascertain for the overlaps which of the two versions is newer, the individual issue/path or the large feature diff.  The relative import changes should not be applied in the standard library; they were specifically removed earlier.
msg149945 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2011-12-21 00:47
I checked the submitted patches from the issues against the large patch by eye. Guilherme's patches in these separate issues have the same contents: issue1207589, issue1612262, issue1721083, issue6699, issue3359.

The large patch updates issue964437, but the "view_file" change is outdated. 

I wrote more recent patches for issue4832 and issue6698.
msg150049 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2011-12-21 22:50
The large patch also contains the same patch in issue6649.
msg188001 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-04-28 16:53
With PEP343 accepted, we can apply changes more uniformly.

I think each of the changes listed should be separate issues with separate review, as most already are (msg149930). 

"Run a script without saving it first." I am sure this has been mentioned on at least 1 other issue, but I cannot find an issue devoted to this.

"The "PseudoStderrFile" in PyShell.py brings the shell forward if an error occurs." The PseudoFiles were updated last fall. Has this behavior been added?
msg296392 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-06-19 23:51
House cleaning: much time has passed since this issue was originally opened and the state of IDLE development has changed dramatically for the better since then, thanks, in large part, to Terry taking charge.  I suspect that nearly all of the individual items here have already been addressed as separate issues.  But, as I no longer have time to follow IDLE development, I am going to reassign this issue to Terry for a final review and closing.
msg296399 - (view) Author: Vedran Čačić (veky) * Date: 2017-06-20 04:13
I'd just like to say that I like

   A configuration preference that permits writing and running
   test programs from the editor without having to save the file
   (you're warned upon quitting whether to save).

very much, it would save me a lot of time, and would like to see it in some future version of IDLE. I can even try to implement it myself, but of course, it would be much better if Terry did it.
msg296502 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-20 23:56
In msg149930, Roger said "There are two major changes that are not covered by other issues (AFAIK). 
1) The "PseudoStderrFile" in PyShell.py brings the shell forward if an error occurs. I like this behavior.
2) Run a script without saving it first. This functionality is scattered across several files.

There are several other small tweaks in the patch that will need some review. "

1. When there is no syntax error, running code already lifts Shell.  I presume the use case is that someone might cover it with something else while a program is running.  In any case, I opened #30719 for this.  Note that the Psuedo classes have been replaced since 2010.

2. Running without saving is #19042.  Two variations are autosave to some file and no save to any file.  I don't know which G.Polo implemented, but #19042 covers both.  There are numerous other possible deviations from F5, as listed in msg296498.

3. I don't think searching for small tweaks is worth the bother, so I'm closing this.  Some things are fixed, some pending, some out-of-date.
History
Date User Action Args
2022-04-11 14:57:07adminsetgithub: 54288
2017-06-20 23:56:45terry.reedysetstatus: open -> closed
resolution: fixed
messages: + msg296502

stage: patch review -> resolved
2017-06-20 04:13:02vekysetnosy: + veky
messages: + msg296399
2017-06-19 23:51:40ned.deilysetassignee: ned.deily -> terry.reedy
messages: + msg296392
versions: + Python 3.7, - Python 2.7, Python 3.3, Python 3.4
2014-02-04 12:12:01taleinatsetnosy: - taleinat
2013-04-28 16:53:37terry.reedysetnosy: + terry.reedy

messages: + msg188001
versions: + Python 2.7, Python 3.3, Python 3.4, - Python 3.2
2013-03-25 18:18:28Todd.Rovitosetnosy: + Todd.Rovito
2012-03-27 07:25:35asvetlovsetnosy: + asvetlov
2011-12-21 22:50:53roger.serwysetmessages: + msg150049
2011-12-21 00:47:52roger.serwysetmessages: + msg149945
2011-12-20 22:14:14ned.deilysetassignee: ned.deily
messages: + msg149932
2011-12-20 21:35:25roger.serwysetmessages: + msg149931
2011-12-20 21:33:34roger.serwysetnosy: + roger.serwy
messages: + msg149930
2011-01-03 23:36:19Bruce.Sherwoodsetnosy: kbk, pitrou, taleinat, ned.deily, eric.araujo, Bruce.Sherwood
messages: + msg125251
2011-01-03 21:49:19ned.deilysetnosy: kbk, pitrou, taleinat, ned.deily, eric.araujo, Bruce.Sherwood
messages: + msg125247
2011-01-03 20:17:22pitrousetnosy: + pitrou
messages: + msg125228
2010-10-19 04:29:26terry.reedylinkissue10137 superseder
2010-10-19 04:20:22Bruce.Sherwoodsetfiles: + idlelib2.7_from_release27-maint.patch

messages: + msg119116
2010-10-17 23:09:53Bruce.Sherwoodsetfiles: + idlelib20101012_from_r32a3.patch

messages: + msg118989
2010-10-15 10:13:50pitrousetnosy: + kbk
2010-10-14 22:46:13eric.araujosetnosy: + eric.araujo
2010-10-14 22:24:47brian.curtinsetnosy: + taleinat
2010-10-14 06:14:09Bruce.Sherwoodsetmessages: + msg118618
2010-10-14 05:29:41ned.deilysetfiles: + issue10079_rebased_for_py3k.patch
versions: + Python 3.2, - Python 3.1
nosy: + ned.deily

messages: + msg118613

stage: patch review
2010-10-13 03:19:55Bruce.Sherwoodcreate