Hello all, A while back, I responded to a post about some IDLE annoyances and said I was more concerned about IDLE 1.04's instablility under Windows. I have a very simple test that causes IDLE to hang, and it does not appear to be fixed in IDLE 1.1. A number of folks who are trying to use Python in education have reported frsutration with the situation. So..., I did some poking around myself. I do not have a very good understanding of the IDLE code, but I think I have found a simple fix for the error I can reproduce reliably. I would appreciate it if some of you who have noticed these problems with IDLE would give my patch a try and let me know if it helps out at all. I have added a single line to the PyShell.py file that lives in Python2.3/lib/idlelib. You can get my modified version here: http://mcsp.wartburg/edu/zelle/Python/PyShell.py. You should be able to use this as a drop-in replacement. Alternatively, you can search in it for my initials (JMZ) to find the line I added and just edit your own copy. Basically, the patch just does the equivalent of a keyboard-interrupt (ctrl-c) before closing the shell window. Any feedback on this would be greatly appreciated. A number of schools are wondering what they should use for Winter term. It would be a real shame if this flaw in IDLE causes Python to lose ground. --John ps. With this "fix", killing the IDLE shell window will produce a little "chatter" before it goes away. I can live with that.
Oooops. The link below should be: http://mcsp.wartburg.edu/zelle/python/PyShell.py John Zelle wrote:
Hello all,
A while back, I responded to a post about some IDLE annoyances and said I was more concerned about IDLE 1.04's instablility under Windows. I have a very simple test that causes IDLE to hang, and it does not appear to be fixed in IDLE 1.1. A number of folks who are trying to use Python in education have reported frsutration with the situation. So..., I did some poking around myself. I do not have a very good understanding of the IDLE code, but I think I have found a simple fix for the error I can reproduce reliably.
I would appreciate it if some of you who have noticed these problems with IDLE would give my patch a try and let me know if it helps out at all. I have added a single line to the PyShell.py file that lives in Python2.3/lib/idlelib. You can get my modified version here:
http://mcsp.wartburg/edu/zelle/Python/PyShell.py.
You should be able to use this as a drop-in replacement. Alternatively, you can search in it for my initials (JMZ) to find the line I added and just edit your own copy. Basically, the patch just does the equivalent of a keyboard-interrupt (ctrl-c) before closing the shell window.
Any feedback on this would be greatly appreciated. A number of schools are wondering what they should use for Winter term. It would be a real shame if this flaw in IDLE causes Python to lose ground.
--John
ps. With this "fix", killing the IDLE shell window will produce a little "chatter" before it goes away. I can live with that.
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
On Wed, Dec 15, 2004 at 12:33:49PM -0600, John Zelle wrote:
I was more concerned about IDLE 1.04's instablility under Windows. I have a very simple test that causes IDLE to hang, and it does not appear to be fixed in IDLE 1.1.
I'd like to try out your fix on my Windows 98 machine, but I'm not sure if I'm seeing the same problem as you. Please post your simple test that causes IDLE to hang. Thanks, David H.
I think my first reply to this went only to David. For others who might be interested, here's the scoop. The problem folks have been having is that IDLE sometimes loses communication with its subprocess. This can cause IDLE to freeze or be unable to bring the shell window up because the socket is in use. It's hard to recreate exactly what does this, as it seems to be a sporadic (race condition?) problem. There is a situation where I can reliably cause IDLE to hang. Simply create a program that has an input statement such as: x = input("Testing ") Run the program with <F5> and when the prompt "Testing " comes up, close the shell window to go back to the program window. Usually, this will hang IDLE. If it doesn't happen the first time, do <F5> - close again. Versions of IDLE since 1.0 will freeze after 1 or two rounds of this. My "patch" just does the equivalent of a keyboard interrupt before closing the shell, since I've found that doing a Ctrl-c before closing seems to avoid the problem. BTW, my fix is for IDLE 1.04 shipped with Python 2.3.3. I don't think it works for IDLE 1.1 in Python 2.4 :-( --John David Handy wrote:
On Wed, Dec 15, 2004 at 12:33:49PM -0600, John Zelle wrote:
I was more concerned about IDLE 1.04's instablility under Windows. I have a very simple test that causes IDLE to hang, and it does not appear to be fixed in IDLE 1.1.
I'd like to try out your fix on my Windows 98 machine, but I'm not sure if I'm seeing the same problem as you.
Please post your simple test that causes IDLE to hang.
Thanks,
David H. _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
John Zelle wrote:
I think my first reply to this went only to David. For others who might be interested, here's the scoop.
The problem folks have been having is that IDLE sometimes loses communication with its subprocess. This can cause IDLE to freeze or be unable to bring the shell window up because the socket is in use. It's hard to recreate exactly what does this, as it seems to be a sporadic (race condition?) problem.
There is a situation where I can reliably cause IDLE to hang. Simply create a program that has an input statement such as: x = input("Testing ") Run the program with <F5> and when the prompt "Testing " comes up, close the shell window to go back to the program window. Usually, this will hang IDLE. If it doesn't happen the first time, do <F5> - close again. Versions of IDLE since 1.0 will freeze after 1 or two rounds of this.
My "patch" just does the equivalent of a keyboard interrupt before closing the shell, since I've found that doing a Ctrl-c before closing seems to avoid the problem.
BTW, my fix is for IDLE 1.04 shipped with Python 2.3.3. I don't think it works for IDLE 1.1 in Python 2.4 :-(
Quick clarification: This should work with any of the 1.0x IDLEs shipped with Python 2.3.x
participants (2)
-
David Handy -
John Zelle