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.

classification
Title: Turtle.py hangs Idle
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: asvetlov Nosy List: ajaksu2, amaury.forgeotdarc, asvetlov, ezio.melotti, gpolo, kbk, ned.deily, rhettinger, terry.reedy, tso
Priority: normal Keywords:

Created on 2004-10-15 03:51 by tso, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (10)
msg22698 - (view) Author: Taro Ogawa (tso) Date: 2004-10-15 03:51
1 line fix:

After line 336's:
   root.destroy()
insert
   root.quit()

[Since IDLE is Tkinter based, the implict quit can't 
happen immediately.  Worse, the shell has difficulty 
resetting and using a ^C can leave a zombie process]

-T.
msg22699 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-10-24 00:35
Logged In: YES 
user_id=80475

What version of Python are you using?
I cannot reproduce this on Py2.3 or on Py2.4b1.
msg22700 - (view) Author: Taro Ogawa (tso) Date: 2004-10-25 00:46
Logged In: YES 
user_id=121025

Sorry - should have included this:
NT4, Python 2.3.3
[This isn't an isolated case - I've had problems with other 
programs behaving similarly on my XP box (using 2.3.4), eg 
the pygame demos].   Windows only thing...?

-T.
msg22701 - (view) Author: Taro Ogawa (tso) Date: 2005-06-21 10:24
Logged In: YES 
user_id=121025

I've tracked down some more info:

It also happens on XP using 2.4.1 and Idle 1.1.1.

The way to trigger it is to start IDLE with no subprocess. 
The way that I got that to happen is to right click on
Turtle.py in Windows Explorer, and select "Edit with IDLE".

While the fix that I suggested still cures it, it may be
possible to achieve a better general solution by leaving
turtle.py alone, and fixing IDLE...

-T.
msg82097 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-14 18:19
Given that it wasn't possible to reproduce the bug in 2.4 nor 2.4, I'll
close this unless someone is against that.
msg82340 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-17 16:00
Taro, the OP, has been able to reproduce the issue with Python 3.0.
Leaving open, details on how to reproduce forthcoming.
msg82419 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-18 14:40
Here's Taro message:
"""
Turtle.py hanging is hardly important, but it's symptomatic of an
underlying problem, and I can still reproduce in Python 3...

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32
System is Windows XP

The procedure to reproduce is:
a/ Open the directory in Explorer (for me it's D:\Python30\Lib)
b/ right click on Turtle.py and select the "Edit with IDLE" menu option
    (IDLE will open with an "IDLE 3.0      ==== No Subprocess ====" in
the header, along with a turtle.py window; the Shell menu will be missing)
c/ hit the F5 key to run turtle.py
d/ let the demo run
e/ click on the turtle
    (Turtle has not quit and returned to the prompt)
f/ ^Q out of IDLE (yes to force-quit)
g/ Open the Windows Task Manager
    (You now have a zombie pythonw.exe process)
"""
msg82553 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-02-20 22:42
I started Idle from a command prompt:
   C:\Python30>python Lib\idlelib\idle.py
And followed the instructions. After the step f/ I got the error 
message:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python30\Lib\tkinter\__init__.py", line 1405, in __call__
    return self.func(*args)
  File "C:\Python30\Lib\tkinter\__init__.py", line 493, in callit
    func(*args)
  File "C:\Python30\lib\idlelib\ColorDelegator.py", line 152, in 
recolorize
    self.recolorize_main()
  File "C:\Python30\lib\idlelib\ColorDelegator.py", line 185, in 
recolorize_main
    next = self.index(mark + "+%d lines linestart" %
  File "C:\Python30\Lib\idlelib\Delegator.py", line 10, in __getattr__
    attr = getattr(self.delegate, name) # May raise AttributeError
AttributeError: 'NoneType' object has no attribute 'index'
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python30\Lib\tkinter\__init__.py", line 1405, in __call__
    return self.func(*args)
  File "C:\Python30\lib\idlelib\MultiCall.py", line 165, in handler
    r = l[i](event)
  File "C:\Python30\lib\idlelib\IOBinding.py", line 222, in open
    self.editwin.flist.open(filename)
  File "C:\Python30\lib\idlelib\FileList.py", line 36, in open
    edit = self.EditorWindow(self, filename, key)
  File "C:\Python30\Lib\idlelib\PyShell.py", line 114, in __init__
    if self.io.filename: self.restore_file_breaks()
  File "C:\Python30\Lib\idlelib\PyShell.py", line 222, in 
restore_file_breaks
    filename = self.io.filename
AttributeError: 'NoneType' object has no attribute 'filename'
msg147944 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-11-19 13:54
Can you still reproduce this?
I tried on winxp with Python 3.2 and following the steps in msg82419 (or even if I open IDLE from cmd as msg82553 suggests) I get a popup error that says "IDLE's subprocess didn't make connection".  If I open IDLE, do File->Open->turtle.py I can run the demo and do Ctrl+Q with no tracebacks.
msg157594 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-04-05 14:23
Closing as not reproducible for 3.3. 
The bug is too minor to worry about 2.7 and 3.2 even if it present (all works for me by the way).
Please reopen if you will get described issue.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41023
2012-04-05 14:23:16asvetlovsetstatus: open -> closed

assignee: asvetlov

nosy: + asvetlov
messages: + msg157594
resolution: out of date
stage: test needed -> resolved
2011-11-19 13:54:02ezio.melottisetnosy: + terry.reedy, ned.deily, ezio.melotti, kbk

messages: + msg147944
versions: + Python 3.3, - Python 3.1
2010-08-19 17:41:54BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6, Python 3.0
2009-04-26 22:18:49ajaksu2setnosy: + gpolo
2009-02-20 22:42:43amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg82553
2009-02-18 14:40:27ajaksu2setmessages: + msg82419
2009-02-17 16:00:53ajaksu2setmessages: + msg82340
versions: + Python 3.0
2009-02-14 18:19:45ajaksu2settype: behavior
stage: test needed
messages: + msg82097
nosy: + ajaksu2
versions: + Python 2.6
2004-10-15 03:51:21tsocreate