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 amaury.forgeotdarc, belopolsky, python-dev, roger.serwy, terry.reedy, william.barr
Date 2012-05-27.01:22:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338081768.15.0.0043427452403.issue10365@psf.upfronthosting.co.za>
In-reply-to
Content
I verified problem in 3.3 and when opening dialog from shell.
Patch fixes problem, including open idle, open dialog, close shell, select file, and now file is opened. Thanks Roger. I went ahead and applied fix. (But note: your patch had a 'blank' line with several spaces. Not allowed. We both should remember to run whitespace-at-end-of-line stripper.)

I did not close yet because I think the comments need improvement (and perhaps made into doc string). Hence 'needs (second) patch'.

      # If the current window has no filename and hasn't been
      # modified, we replace its contents (no loss).  Otherwise
      # we open a new window.  But we won't replace the
      # shell window (which has an interp(reter) attribute), which
      # gets set to "not modified" at every new prompt.

I think that means to say "If the current window is a never-modified new, empty, untitled edit window, load the file there." If it had any contents to replace, I believe it would be either titled or modified. So that seem misleading.

The 'otherwise..open a new window' is not true since a file can be opened (for writing) only once, and if it is already open, focus is simply shifted to its current window.

So I think the behavior can be summarized as "If the file is already open in an edit window, shift focus to that window. Otherwise open a new window (or use the current window if it is new, unmodified, and untitled) and load the file."

      # Also, make sure the current window has not been closed,
      # since it can be closed during the Open File dialog.

This seems misplaced where it is since overall we are *not* making sure that the current window is still open, but are taking measures to make sure open works even if it has been closed. I think that the comment that might be added before this block is that flist is being saved in case the parent window gets closed while the dialog is open.

I am also curious if you understand
 # Code for use outside IDLE:
or might this be obsolete?
History
Date User Action Args
2012-05-27 01:22:48terry.reedysetrecipients: + terry.reedy, amaury.forgeotdarc, belopolsky, roger.serwy, william.barr, python-dev
2012-05-27 01:22:48terry.reedysetmessageid: <1338081768.15.0.0043427452403.issue10365@psf.upfronthosting.co.za>
2012-05-27 01:22:47terry.reedylinkissue10365 messages
2012-05-27 01:22:45terry.reedycreate