Issue 26571: turtle regression in 3.5 (original) (raw)

I noticed some odd behaviour when running some turtle code I wrote using python 3.5. A simplified example:

from turtle import Turtle t = Turtle() t.getscreen().bye() # or manually close the turtle window t2 = Turtle() Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.5/turtle.py", line 3816, in init visible=visible) File "/usr/lib64/python3.5/turtle.py", line 2557, in init self._update() File "/usr/lib64/python3.5/turtle.py", line 2660, in _update self._update_data() File "/usr/lib64/python3.5/turtle.py", line 2646, in _update_data self.screen._incrementudc() File "/usr/lib64/python3.5/turtle.py", line 1292, in _incrementudc raise Terminator turtle.Terminator

This code works under 3.4, opening a new turtle window the second time Turtle() is called. Under 3.5, a blank white window opens.

This seems to be related to https://hg.python.org/cpython/rev/1628484c9408, as the only point that raises Terminator is guarded by a check for if not TurtleScreen._RUNNING:

Hi all, Sorry. I seem to have stepped on someone's toes or no one likes turtle any more (as this is active since 2016). As you can see, I am new here and still getting a feel for these procedures. I was preparing a Jupyter notebook for my students. I planned some exercises with turtle at start before we jump into real robots. I noticed this annoying Terminator error, digged deeper into the code to find about the _RUNNING class variable. The PR from Furkan suggest to remove the Raise Terminator. May be we could amend that and I will close my PR, if you prefer.

Thanks,