Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turtle.py hangs Idle #41023

Closed
tso mannequin opened this issue Oct 15, 2004 · 10 comments
Closed

Turtle.py hangs Idle #41023

tso mannequin opened this issue Oct 15, 2004 · 10 comments
Assignees
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@tso
Copy link
Mannequin

tso mannequin commented Oct 15, 2004

BPO 1047540
Nosy @rhettinger, @terryjreedy, @kbkaiser, @amauryfa, @devdanzin, @ned-deily, @ezio-melotti, @asvetlov

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/asvetlov'
closed_at = <Date 2012-04-05.14:23:16.138>
created_at = <Date 2004-10-15.03:51:21.000>
labels = ['expert-IDLE', 'type-bug']
title = 'Turtle.py hangs Idle'
updated_at = <Date 2012-04-05.14:23:16.137>
user = 'https://bugs.python.org/tso'

bugs.python.org fields:

activity = <Date 2012-04-05.14:23:16.137>
actor = 'asvetlov'
assignee = 'asvetlov'
closed = True
closed_date = <Date 2012-04-05.14:23:16.138>
closer = 'asvetlov'
components = ['IDLE']
creation = <Date 2004-10-15.03:51:21.000>
creator = 'tso'
dependencies = []
files = []
hgrepos = []
issue_num = 1047540
keywords = []
message_count = 10.0
messages = ['22698', '22699', '22700', '22701', '82097', '82340', '82419', '82553', '147944', '157594']
nosy_count = 10.0
nosy_names = ['rhettinger', 'terry.reedy', 'kbk', 'amaury.forgeotdarc', 'tso', 'ajaksu2', 'gpolo', 'ned.deily', 'ezio.melotti', 'asvetlov']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1047540'
versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

@tso
Copy link
Mannequin Author

tso mannequin commented Oct 15, 2004

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.

@tso tso mannequin added topic-IDLE labels Oct 15, 2004
@rhettinger
Copy link
Contributor

Logged In: YES
user_id=80475

What version of Python are you using?
I cannot reproduce this on Py2.3 or on Py2.4b1.

@tso
Copy link
Mannequin Author

tso mannequin commented Oct 25, 2004

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.

@tso
Copy link
Mannequin Author

tso mannequin commented Jun 21, 2005

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.

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 14, 2009

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.

@devdanzin devdanzin mannequin added type-bug An unexpected behavior, bug, or error labels Feb 14, 2009
@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 17, 2009

Taro, the OP, has been able to reproduce the issue with Python 3.0.
Leaving open, details on how to reproduce forthcoming.

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 18, 2009

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)
"""

@amauryfa
Copy link
Member

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'

@ezio-melotti
Copy link
Member

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.

@asvetlov
Copy link
Contributor

asvetlov commented Apr 5, 2012

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.

@asvetlov asvetlov closed this as completed Apr 5, 2012
@asvetlov asvetlov self-assigned this Apr 5, 2012
@asvetlov asvetlov closed this as completed Apr 5, 2012
@asvetlov asvetlov self-assigned this Apr 5, 2012
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants