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 regression in 3.5
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Ellison Marks, Robert Harder, ethan.furman, furkanonder, python-dev, serhiy.storchaka, williamnavaraj
Priority: normal Keywords: patch

Created on 2016-03-16 04:59 by Ellison Marks, last changed 2022-04-11 14:58 by admin.

Pull Requests
URL Status Linked Edit
PR 19465 open furkanonder, 2020-04-10 23:06
PR 30332 closed python-dev, 2022-01-02 07:07
PR 30355 open williamnavaraj, 2022-01-03 12:34
Messages (6)
msg261840 - (view) Author: Ellison Marks (Ellison Marks) Date: 2016-03-16 04:59
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 "<stdin>", line 1, in <module>
  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:`
msg263589 - (view) Author: Ellison Marks (Ellison Marks) Date: 2016-04-16 21:22
Just as an update, I've been working around this by manually setting TurtleScreen._RUNNING to True before calling Turtle() again, which produces the desired behaviour in both 3.4 and 3.5. Haven't noticed any bad effects so far.
msg273190 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2016-08-20 07:10
Serhiy, is this a quick fix you can get in?
msg279343 - (view) Author: Robert Harder (Robert Harder) Date: 2016-10-24 22:23
Thanks for pointing out the workaround.  Was driving me crazy.  Possible fix is to add TurtleScreen._RUNNING = True ~line 967 in turtle.py, in TurtleScreen.__init__ function.
msg366212 - (view) Author: Furkan Onder (furkanonder) * Date: 2020-04-11 13:31
PR has been sent.
msg409866 - (view) Author: William Navaraj (williamnavaraj) * Date: 2022-01-06 15:52
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,
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70758
2022-01-06 15:52:29williamnavarajsetmessages: + msg409866
2022-01-03 12:34:02williamnavarajsetnosy: + williamnavaraj
pull_requests: + pull_request28569
2022-01-02 07:07:56python-devsetnosy: + python-dev
pull_requests: + pull_request28547
2021-12-11 18:52:23iritkatrielsetversions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.5
2020-04-11 13:31:54furkanondersetmessages: + msg366212
2020-04-10 23:06:14furkanondersetkeywords: + patch
nosy: + furkanonder

pull_requests: + pull_request18820
stage: needs patch -> patch review
2018-06-16 15:40:09willingcsetstage: needs patch
2016-10-24 22:23:44Robert Hardersetnosy: + Robert Harder
messages: + msg279343
2016-08-20 07:10:04ethan.furmansetmessages: + msg273190
2016-04-16 21:22:20Ellison Markssetmessages: + msg263589
2016-03-16 07:17:33serhiy.storchakasetassignee: serhiy.storchaka

nosy: + serhiy.storchaka
2016-03-16 07:13:52ethan.furmansetnosy: + ethan.furman
2016-03-16 04:59:15Ellison Markscreate