Skip to content

turtle regression in 3.5 #70758

Closed
Closed

Description

@gotyaoi
mannequin
BPO 26571
Nosy @ethanfurman, @serhiy-storchaka, @gotyaoi, @furkanonder, @williamnavaraj
PRs
  • bpo-26571: fix Turtle Terminator Exception #19465
  • bpo-26571-Class variable _RUNNING update at the __init__ end #30332
  • bpo-26571: Reinit class variable _RUNNING #30355
  • 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/serhiy-storchaka'
    closed_at = None
    created_at = <Date 2016-03-16.04:59:15.427>
    labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
    title = 'turtle regression in 3.5'
    updated_at = <Date 2022-01-06.15:52:29.164>
    user = 'https://github.com/gotyaoi'

    bugs.python.org fields:

    activity = <Date 2022-01-06.15:52:29.164>
    actor = 'williamnavaraj'
    assignee = 'serhiy.storchaka'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2016-03-16.04:59:15.427>
    creator = 'Ellison Marks'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 26571
    keywords = ['patch']
    message_count = 6.0
    messages = ['261840', '263589', '273190', '279343', '366212', '409866']
    nosy_count = 7.0
    nosy_names = ['ethan.furman', 'python-dev', 'serhiy.storchaka', 'Ellison Marks', 'Robert Harder', 'furkanonder', 'williamnavaraj']
    pr_nums = ['19465', '30332', '30355']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue26571'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Linked PRs

    Activity

    1. gotyaoi commented on Mar 16, 2016

      gotyaoimannequin
      MannequinAuthor

      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:`

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 16, 2016
    3. gotyaoi commented on Apr 16, 2016

      gotyaoimannequin
      MannequinAuthor

      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.

    4. ethanfurman commented on Aug 20, 2016

      @ethanfurman
      Member

      Serhiy, is this a quick fix you can get in?

    5. RobertHarder commented on Oct 24, 2016

      RobertHardermannequin
      Mannequin

      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.

    6. furkanonder commented on Apr 11, 2020

      furkanondermannequin
      Mannequin

      PR has been sent.

    7. williamnavaraj commented on Jan 6, 2022

      williamnavarajmannequin
      Mannequin

      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,

    8. transferred this issue fromon Apr 10, 2022
    9. added
      3.13only security fixes
      3.14bugs and security fixes
      3.15bugs and security fixes
      3.16new features, bugs and security fixes
      and removed
      3.11only security fixes
      on Aug 9, 2026
    10. added 3 commits that reference this issue on Aug 9, 2026
    11. added a commit that references this issue on Aug 14, 2026
    12. added a commit that references this issue on Oct 10, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    3.13only security fixes3.14bugs and security fixes3.15bugs and security fixes3.16new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions