[Idle-dev] Fix for long delays

Douglas S. Blank dblank at brynmawr.edu
Tue May 27 04:43:39 CEST 2008


Dave,

Just tried it, and got this error under Linux:

Exception exceptions.AttributeError: "'NoneType' object has no attribute
'maxint'" in <bound method Popen.__del__ of <subprocess.Popen object at
0x9007e0c>> ignored

I had to adjust the patch a bit as it got mangled through the mailer (and
I've attached the version to this email) so please check that I got it
all.

I agree that for the us the "no subprocess mode" causes confusion. I'd
vote to make get rid of it, or at least to not make it the default.

I'd also get rid of that scary message:

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************

Surely we don't need that, or could test to see if everything started ok
and only display it then?

Finally, having f5 restart the shell was absolutely the wrong thing for
us. We usually have an open connection to a robot, and we're writing code
to control it. I submitted a patch to allow an alternate control+f5 to run
the module without restarting the shell.

If we can get a working version of this patch, I'd vote for it.

-Doug

On Mon, May 26, 2008 10:03 pm, David Scherer said:
> Bruce: Thanks for correcting my earlier posting error!  The problem with
> loading IDLE from the shell context menu is that the default binding runs
> IDLE with the "no subprocess" command line option (you can see this in the
> output window if you look, and you can correct it by changing the command
> line for the "Edit" action in explorer by hand).  My guess is that this is
> because of some real or perceived problem with running multiple instances
> of
> IDLE in the usual subprocess mode.  I think it would be a good idea to
> remove the "no subprocess" option from the shell binding, and fix any
> problem with the coexistence of multiple subprocess-based IDLE instances.
>
> Douglas:
>
> Your use of IDLE, like ours, required some similar changes. Perhaps Dave
>> can list out, point by point, the changes the patch makes, and we can
>> discuss those?
>
>
> The patch is really very simple: when IDLE wants to terminate the
> subprocess, it uses the most direct and powerful command available from
> the
> operating system to do it, instead of asking the subprocess to terminate
> itself in a relatively unreliable way.  This is the most straightforward,
> easy, efficient and elegant way to do the job.  The only reason it's more
> than a couple of lines of code is because Python provides slightly
> different
> interfaces to do this on UNIX and Windows (reflecting the slightly
> different
> operating system APIs).
>
> I'd be in favor of IDLE instantly killing the shell on exit, and for
>> making it generally more useful for VPython (and for us). In fact, I'm
>> going to try the patch tonight to see if it would work for our uses too.
>> Perhaps we can get rid of our hacks in favor of a general solution. (I
>> think that Tal incorporated a version of F5 that only reloaded the
>> module
>> and didn't restart the shell. But I just downloaded Python2.5 for
>> Windows
>> and see that IDLE is still version 1.2.2 :( )
>
>
> Restarting the shell is essential for us: it's impossible to reliably
> return
> a program to its initial state by any other method.  It's one of the major
> advantages of the subprocess model.
>
> Please let us know how my patch works for you!
>
> Dave
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev at python.org
> http://mail.python.org/mailman/listinfo/idle-dev
>


-- 
Douglas S. Blank
Associate Professor, Bryn Mawr College
http://cs.brynmawr.edu/~dblank/
Office: 610 526 6501
-------------- next part --------------
A non-text attachment was scrubbed...
Name: idle-kill.patch
Type: text/x-patch
Size: 2342 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20080526/48448dba/attachment.bin>


More information about the IDLE-dev mailing list