Skip to content

idlelib for Python 3 with Guilherme Polo GSoC enhancements #54288

Closed

Description

@BruceSherwood
BPO 10079
Nosy @terryjreedy, @kbkaiser, @pitrou, @ned-deily, @serwy, @merwok, @asvetlov, @rovitotv, @vedgar
Files
  • vidle20101012.diff: diff file between idlelib and enhancements
  • issue10079_rebased_for_py3k.patch
  • idlelib20101012_from_r32a3.patch
  • idlelib2.7_from_release27-maint.patch: patch built from release27-maint branch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2017-06-20.23:56:45.906>
    created_at = <Date 2010-10-13.03:19:55.319>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'idlelib for Python 3 with Guilherme Polo GSoC enhancements'
    updated_at = <Date 2017-06-20.23:56:45.904>
    user = 'https://bugs.python.org/BruceSherwood'

    bugs.python.org fields:

    activity = <Date 2017-06-20.23:56:45.904>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2017-06-20.23:56:45.906>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2010-10-13.03:19:55.319>
    creator = 'Bruce.Sherwood'
    dependencies = []
    files = ['19211', '19229', '19259', '19279']
    hgrepos = []
    issue_num = 10079
    keywords = ['patch']
    message_count = 17.0
    messages = ['118501', '118613', '118618', '118989', '119116', '125228', '125247', '125251', '149930', '149931', '149932', '149945', '150049', '188001', '296392', '296399', '296502']
    nosy_count = 10.0
    nosy_names = ['terry.reedy', 'kbk', 'pitrou', 'ned.deily', 'roger.serwy', 'eric.araujo', 'asvetlov', 'Todd.Rovito', 'Bruce.Sherwood', 'veky']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue10079'
    versions = ['Python 3.7']

    Activity

    1. BruceSherwood commented on Oct 13, 2010

      BruceSherwoodmannequin
      MannequinAuthor

      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.

    2. ned-deily commented on Oct 14, 2010

      @ned-deily
      Member

      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).

    3. BruceSherwood commented on Oct 14, 2010

      BruceSherwoodmannequin
      MannequinAuthor

      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.

    4. BruceSherwood commented on Oct 17, 2010

      BruceSherwoodmannequin
      MannequinAuthor

      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.

    5. BruceSherwood commented on Oct 19, 2010

      BruceSherwoodmannequin
      MannequinAuthor

      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.

    6. pitrou commented on Jan 3, 2011

      @pitrou
      Member

      Ping. IDLE dead again?

    7. ned-deily commented on Jan 3, 2011

      @ned-deily
      Member

      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.

    8. BruceSherwood commented on Jan 3, 2011

      BruceSherwoodmannequin
      MannequinAuthor

      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.

    9. serwy commented on Dec 20, 2011

      serwymannequin
      Mannequin

      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:
      bpo-964437 - "idle help is modal"

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

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

      FileRevert.py:
      patch in bpo-1721083 - "Add File - Reload"

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

      PyShell.py:
      - use "subprocess" module - already fixed in bpo-12540
      - patch for "paste_callback" in bpo-3359 - "Pasted \n not same as typed \n"
      - fix for bpo-6698 "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.

    10. serwy commented on Dec 20, 2011

      serwymannequin
      Mannequin

      minor mistake - bpo-3559 "Pasted \n not same as typed \n"

    11. ned-deily commented on Dec 20, 2011

      @ned-deily
      Member

      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.

    12. self-assigned this
      on Dec 20, 2011
    13. serwy commented on Dec 21, 2011

      serwymannequin
      Mannequin

      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: bpo-1207589, bpo-1612262, bpo-1721083, bpo-6699, bpo-3359.

      The large patch updates bpo-964437, but the "view_file" change is outdated.

      I wrote more recent patches for bpo-4832 and bpo-6698.

    14. serwy commented on Dec 21, 2011

      serwymannequin
      Mannequin

      The large patch also contains the same patch in bpo-6649.

    15. terryjreedy commented on Apr 28, 2013

      @terryjreedy
      Member

      With PEP-343 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?

    16. ned-deily commented on Jun 19, 2017

      @ned-deily
      Member

      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.

    17. vedgar commented on Jun 20, 2017

      vedgarmannequin
      Mannequin

      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.

    18. terryjreedy commented on Jun 20, 2017

      @terryjreedy
      Member

      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 bpo-30719 for this. Note that the Psuedo classes have been replaced since 2010.

      2. Running without saving is bpo-19042. Two variations are autosave to some file and no save to any file. I don't know which G.Polo implemented, but bpo-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.

    19. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions