[Idle-dev] Submitted Guilherme Polo's enhancement

Bruce Sherwood basherwo at ncsu.edu
Thu Oct 14 08:18:35 CEST 2010

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
an earlier file at vpython.org.

Since you've expressed interest in the Mac, I'll post here some
comments I sent to Tal Einat this evening:

I've found a bug (or maybe it's two bugs) in IDLE, which also affects
VIDLE (shorthand for IDLE with my diffs applied).

On Windows, using the command line, cd to the idlelib directory, then
execute c:\Python31\python idle.pyw. Create a new edit window (if
there isn't one already) and enter some text, but don't save. Press
ctrl-Q to quit, and you're asked whether you want to save the file.
Say yes, and deliberately overwrite an existing file. The file gets
saved, and Python exits, but you'll see in the command line window an
error in Multicall.py, line 221; trying to remove a func from a list
of funcs. If you put print statements in Multicall to debug the
problem you'll find that the func isn't in the list because it's
memory address doesn't match. In a way, one could say that it doesn't
matter, because the file does get saved, it's just that the exit isn't
graceful. But it's worrisome.

On Mac, the situation is worse, in that when you press cmd-Q to quit,
and you have unsaved changes, Python just quits without asking you
whether to save the file. This happens whether you're working with an
as-yet unsaved file or a saved file to which you've added some text.

Again, I emphasize that these are problems of IDLE, not just VIDLE.
I'm telling you this rather than filing a bug report at this time on
the chance that with your knowledge of IDLE you'll see the problem and
fix it in the process of trying out VIDLE. Obviously the Mac problem
is quite serious, because you can lose work.

Here's another piece of information. On Windows, running from the
command line, if I click the window close button I don't get the
error, only if I hit ctrl-Q.

I'm trying to trace where cmd-Q goes on the Mac and so far I've failed
to find it. In particular, neither the close routines in EditorWindow
(which are driven by clicking the close box on a window)m nor
close_all_callback in FileListm are driven by cmd-Q.

So I'm puzzled; cmd-Q does quit Python but I haven't figured out how.
Evidently it's taking a branch that does no checks for needing to save
a file.


On Wed, Oct 13, 2010 at 11:51 PM, Ned Deily <nad at acm.org> wrote:
> In article
> <AANLkTimqCTK2op+ZA4vqMQqW+Z32mkf7ztp=Fz8sRDYe at mail.gmail.com>,
>  Bruce Sherwood <basherwo at ncsu.edu> wrote:
>> With great help from Tal Einat on the mechanics of how to submit
>> Guilherme Polo's enhancements, I've presented a diff file to
>> bugs.python.org against the Python 3.1.2 version of idlelib (tag
>> r312).
> Thanks for getting the changes submitted!
> BTW, I was looking into some other issues with IDLE on OS X and was
> interested to see whether these enhancements would have any effect on
> what I was seeing.  Normally, at this stage, new features would only be
> checked into the py3k branch (the main development branch) of the python
> source trees (rather than the 3.1.x branch which is generally only
> accepting bug fixes) so I decided to do a quick forward port of the
> patch to py3k.  I've uploaded that patch to the issue tracker.  As I
> noted there, I found that it had no affect on the other issues so I'm
> not planning to do any more work on the ported patch but it might be of
> some use as a head start on the py3k port.
> http://bugs.python.org/issue10079
> --
>  Ned Deily,
>  nad at acm.org

More information about the IDLE-dev mailing list