[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2015-02-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2015-02-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 15dd9d6cc632 by Serhiy Storchaka in branch '2.7':
Issue #6639: Module-level turtle functions no longer raise TclError after
https://hg.python.org/cpython/rev/15dd9d6cc632

New changeset 1628484c9408 by Serhiy Storchaka in branch '3.4':
Issue #6639: Module-level turtle functions no longer raise TclError after
https://hg.python.org/cpython/rev/1628484c9408

New changeset d8e494986caf by Serhiy Storchaka in branch 'default':
Issue #6639: Module-level turtle functions no longer raise TclError after
https://hg.python.org/cpython/rev/d8e494986caf

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2015-02-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2015-02-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Any feedback?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-09-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is more complete patch.

--
Added file: http://bugs.python.org/file36531/turtledemo_destroy.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-08-29 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +serhiy.storchaka
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-07-30 Thread Lita Cho

Lita Cho added the comment:

I can make it worth such that it doesn't raise a Terminator error. This works 
great when working with Turtle on the command line. I basically check if the 
root exists for all Tk canvas calls. 

If it got destroyed, then it just returns. However, if you run the following 
recursive code, it will just keep popping up a window forever unless you Ctrl+C 
out of the program. So that is not going to work. I still believe raising an 
error is the proper approach.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-07-13 Thread Jessica McKellar

Changes by Jessica McKellar :


--
keywords: +needs review
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-06-02 Thread Lita Cho

Lita Cho added the comment:

Oops, pressed submit too soon.

Now the programs raise a Terminator exception rather than a TclError, which I 
think is correct because the programs are calling Turtle methods when the 
TurtleScreen had been destroyed. 

I wasn't sure if it was better to return None rather than raise an exception, 
but I think raising exception is correct, as these programs are not calling 
mainloop to handle event loops. So when the user closes the window, 
round_dance.py should handle that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-06-02 Thread Lita Cho

Lita Cho added the comment:

So it looks like the bug fix was really simple. I just needed to set 
TurtleScreen._RUNNING to True when the screen object tries to get destroyed.

--
Added file: http://bugs.python.org/file35462/turtle_crash.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-27 Thread Lita Cho

Lita Cho added the comment:

So I have a patch that fixes the original problem, but doesn't fix the crash 
with the tdemo_round_dance.py. However, I was wondering why 
TurtleScreen._RUNNING = True in the _destroy method. Can anyone shed some light 
on this? Here is the current state of my patch.

--
keywords: +patch
Added file: http://bugs.python.org/file35384/turtle_bug.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-23 Thread Lita Cho

Lita Cho added the comment:

I was looking at this more, and from my understanding, the turtle code is 
continuing to run even when the TK window is destroyed. Thus the crash.

It looks like the drawing functions are being made on the fly with the 
following method:

for methodname in _tg_turtle_functions:
pl1, pl2 = getmethparlist(eval('Turtle.' + methodname))
if pl1 == "":
print(">>", pl1, pl2)
continue
defstr = ("def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)s" %
   {'key':methodname, 'pl1':pl1, 'pl2':pl2})
exec(defstr)
eval(methodname).__doc__ = 
_turtle_docrevise(eval('Turtle.'+methodname).__doc__)

So while all the methods are being generated, I am going to add in a check to 
see if the window was destroyed before running the pen code. If it was, then I 
exit gratefully. The check will be duplicated for each pen method, but I feel 
it is the best way to contain the check within the turtle.py module. The other 
option would be to make the user check for it, which is not a good option.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-23 Thread Lita Cho

Changes by Lita Cho :


___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2014-05-23 Thread Lita Cho

Changes by Lita Cho :


--
nosy: +Lita.Cho, jesstess

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2012-03-25 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2010-10-27 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2010-10-27 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Same error occurs when the python -m turtle demo is interrupted by closing the 
window.  I think the correct fix is to exit when the window is closed, but I 
cannot figure out the best way to achieve that.  This probably should be done 
at the application/test level.

--
nosy: +gregorlingl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2010-10-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I have come across the same bug.  To reproduce, run 
Demo/turtle/tdemo_round_dance.py and kill the Tk window before the "dance" 
stops. 

The mysterious command name ".10170160" is simply the generated name for the 
canvas widget - '.' + repr(id(self)).  See BaseWidget.__init__ in tkinter.

--
nosy: +belopolsky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2010-07-10 Thread Mark Lawrence

Mark Lawrence  added the comment:

Anyone with turtle/Tkinter knowledge who can shed some light on this?

--
nosy: +BreamoreBoy
stage:  -> needs patch
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2009-08-03 Thread Sridhar Ratnakumar

Changes by Sridhar Ratnakumar :


--
components: +Tkinter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6639] turtle: _tkinter.TclError: invalid command name ".10170160"

2009-08-03 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

I tried the following turtle program; it was taking some time to 
draw .. so I pressed C-c after which I saw the exception traceback.

> cat play.py 
from turtle import *

def f(length, depth):
   if depth == 0:
 forward(length)
   else:
 f(length/3, depth-1)
 right(60)
 f(length/3, depth-1)
 left(120)
 f(length/3, depth-1)
 right(60)
 f(length/3, depth-1)

f(500, 4)

> python play.py
Traceback (most recent call last):
  File "/Users/sridharr/as/pypm/bin/python", line 41, in 
execfile(sys.argv[0])
  File "play.py", line 15, in 
f(500, 4)
  File "play.py", line 11, in f
f(length/3, depth-1)
  File "play.py", line 7, in f
f(length/3, depth-1)
  File "play.py", line 9, in f
f(length/3, depth-1)
  File "play.py", line 10, in f
left(120)
  File "", line 1, in left
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
lib-tk/turtle.py", line 1612, in left
self._rotate(angle)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
lib-tk/turtle.py", line 3107, in _rotate
self._update()
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
lib-tk/turtle.py", line 2562, in _update
self._update_data()
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
lib-tk/turtle.py", line 2553, in _update_data
self._pencolor, self._pensize)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
lib-tk/turtle.py", line 569, in _drawline
self.cv.coords(lineitem, *cl)
  File "", line 1, in coords
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
lib-tk/Tkinter.py", line 2136, in coords
self.tk.call((self._w, 'coords') + args)))
_tkinter.TclError: invalid command name ".10170160"
>

--
components: Library (Lib)
messages: 91248
nosy: srid
severity: normal
status: open
title: turtle: _tkinter.TclError: invalid command name ".10170160"
type: behavior
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com