Skip to content

Turtledemo: exception and minor glitches. #58325

Description

@terryjreedy
BPO 14117
Nosy @rhettinger, @terryjreedy, @vstinner, @willingc, @miss-islington
PRs
  • bpo-14117: Make minor tweaks to turtledemo #8002
  • [3.7] bpo-14117: Make minor tweaks to turtledemo (GH-8002) #8003
  • [3.6] bpo-14117: Make minor tweaks to turtledemo (GH-8002) #8004
  • Dependencies
  • bpo-21597: Allow turtledemo code pane to get wider.
  • bpo-21823: Catch turtle.Terminator exceptions in turtledemo
  • bpo-21882: turtledemo modules imported by test___all__ cause side effects or failures
  • bpo-21933: Allow the user to change font sizes with the text pane of turtledemo
  • bpo-21971: Index and update turtledemo doc.
  • bpo-22051: Turtledemo: stop reloading demos
  • Files
  • 14117_tree_output.patch: Removes print in tree demo
  • 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/terryjreedy'
    closed_at = <Date 2018-06-29.05:33:08.183>
    created_at = <Date 2012-02-24.21:52:45.185>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'Turtledemo: exception and minor glitches.'
    updated_at = <Date 2018-10-24.22:47:40.911>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2018-10-24.22:47:40.911>
    actor = 'vstinner'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2018-06-29.05:33:08.183>
    closer = 'terry.reedy'
    components = ['Library (Lib)']
    creation = <Date 2012-02-24.21:52:45.185>
    creator = 'terry.reedy'
    dependencies = ['21597', '21823', '21882', '21933', '21971', '22051']
    files = ['38986']
    hgrepos = []
    issue_num = 14117
    keywords = ['patch']
    message_count = 15.0
    messages = ['154164', '221482', '221509', '221518', '221980', '223774', '223783', '240876', '319752', '320696', '320697', '320699', '320701', '320702', '328398']
    nosy_count = 7.0
    nosy_names = ['rhettinger', 'terry.reedy', 'vstinner', 'python-dev', 'willingc', 'cabiad', 'miss-islington']
    pr_nums = ['8002', '8003', '8004']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14117'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    Activity

    1. terryjreedy commented on Feb 24, 2012

      @terryjreedy
      MemberAuthor

      Win7, 3.2.2, python -m turtledemo in Command Prompt Window

      After running clock example, hitting Stop results in following:
      Clock face, including hands, is erased. Day and date are left (intentional?), and the following appears back in command prompt window.

      Exception in Tkinter callback
      Traceback (most recent call last):
        File "C:\Programs\Python32\lib\tkinter\__init__.py", line 1399, in __call__
          return self.func(*args)
        File "C:\Programs\Python32\lib\tkinter\__init__.py", line 487, in callit
          func(*args)
        File "C:\Programs\Python32\lib\turtledemo\clock.py", line 116, in tick
          second_hand.setheading(6*sekunde)
        File "C:\Programs\Python32\lib\turtle.py", line 1936, in setheading
          self._rotate(angle)
        File "C:\Programs\Python32\lib\turtle.py", line 3279, in _rotate
          self._update()
        File "C:\Programs\Python32\lib\turtle.py", line 2660, in _update
          self._update_data()
        File "C:\Programs\Python32\lib\turtle.py", line 2646, in _update_data
          self.screen._incrementudc()
        File "C:\Programs\Python32\lib\turtle.py", line 1285, in _incrementudc
          raise Terminator
      turtle.Terminator

      Demo continues to run.

      Paint: Left clicking mouse moves dot without painting. Right clicking changes mode so left clicking draws line. It also causes some filling of enclosed regions. This double action is slightly obscure. The prompt on the bottom of the screen says "Use mouse/keys or Stop" As near as I can tell, keys are inactive. So prompt could delete '/keys'.

      Module doc strings that explain each demo should be wrapped so that they appear in the code window without scrolling. Or the left window could be wider, especially if the user widens the window. 800x600 screens are pretty rare these days.

      'Wikipedia' is a poor name for something just because it happened to be there. 'Rosette', for instance, would be better.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Feb 24, 2012
    3. BreamoreBoy commented on Jun 24, 2014

      BreamoreBoymannequin
      Mannequin

      Confirmed still a problem in 3.4.1 on Win7.

    4. terryjreedy commented on Jun 24, 2014

      @terryjreedy
      MemberAuthor

      bpo-21823 fixed the Terminator issue 3 days ago.

      bpo-21597 is about making the text pane resizable.
      The doc strings for peace, planet_and_moon, and tree need a bit of re-wrapping. The paint instruction is wrong. I am working on these now.

      "Use mouse/keys or Stop" is a generic prompts for all 'special' demos that continue after xyz.main returns. keys is never right for the current set of demos.

      The text for two_canvases does not load. I think this can be fixed.

    5. self-assigned this
      on Jun 24, 2014
    6. python-dev commented on Jun 25, 2014

      python-devmannequin
      Mannequin

      New changeset 129ec3d90a67 by Terry Jan Reedy in branch '2.7':
      Issue bpo-14117: Inprove help text and docstrings, some for clarity, some just to
      http://hg.python.org/cpython/rev/129ec3d90a67

      New changeset 713a774ca68a by Terry Jan Reedy in branch '3.4':
      Issue bpo-14117: Inprove help text and docstrings, some for clarity, some just to
      http://hg.python.org/cpython/rev/713a774ca68a

    7. terryjreedy commented on Jun 30, 2014

      @terryjreedy
      MemberAuthor

      21884 removed or moved global system-changing or gui calls to main. Wrapping two_canvases code (except for window preserving mainloop) to a new main fixed its problems.

      Should remove reload from main driver, and test.

    8. terryjreedy commented on Jul 23, 2014

      @terryjreedy
      MemberAuthor

      Added bpo-21933, change text font size, as dependency.
      Added new bpo-22051 remove reload, as dependency.
      bpo-18132: stop demo buttons from disappearing, was fixed by bpo-21507 patch.

    9. terryjreedy commented on Jul 23, 2014

      @terryjreedy
      MemberAuthor

      bpo-22053 added main(), eliminated 'while RUN', and fixed this a 3.x debug shutdown message.

      The main remaining problem I am aware of now is that some demos 'print' messages to the console (or shell), which would be a problem if there were not one (as with pythonw). Except for one demo, the messages would fit on the demo window message button. A possible fix would be to call demo.main with the button, so mainloop demos could write back to it.
      (Normal demo returns are put there now.)

    10. cabiad commented on Apr 14, 2015

      cabiadmannequin
      Mannequin

      Running through each of the demos, it seems as though only 'penrose' and 'tree' have console/shell output.

      'penrose' output is a list of information about the current rendering and has a format like:
      Calculation: 0.0009 s
      Drawing: 0.0074 s
      Together: 0.0083 s
      5 kites and 0 darts = 5 pieces.
      (... This repeats with updated information for each rendering ...)

      I believe that there's too much output right now to include this in the demo window's message button area. It might be interesting to show most or all of this information with a turtle.write() in the graphical area, but I think that the better option is just to remove (or at least comment out) the timing information entirely and show only the '5 kites and 0 darts = 5 pieces' portion in the message button area.

      I could submit a patch for either 'penrose' option if there's interest.

      The 'tree' prints a count of the number of turtles created at the end of the run. Console output looks like:
      1024

      I think this is not very useful, except perhaps when debugging the demo. I've attached a patch which removes this output.

    11. willingc commented on Jun 16, 2018

      @willingc
      Contributor

      Hi @terry.reedy,

      I'm triaging open "turtle" issues. What do you think would be a reasonable next step for this issue? Perhaps: a contributor runs the demo and reports back here with the current behavior experienced.

    12. terryjreedy commented on Jun 29, 2018

      @terryjreedy
      MemberAuthor

      bpo-21884 was closed as a duplicate of bpo-21882 and hence not a separate dependency.

    13. terryjreedy commented on Jun 29, 2018

      @terryjreedy
      MemberAuthor

      PR 8002 fixes the remaining minor problems.

    14. terryjreedy commented on Jun 29, 2018

      @terryjreedy
      MemberAuthor

      New changeset 891a1f8 by Terry Jan Reedy in branch 'master':
      bpo-14117: Make minor tweaks to turtledemo (GH-8002)
      891a1f8

    15. miss-islington commented on Jun 29, 2018

      @miss-islington
      Contributor

      New changeset e2c5a75 by Miss Islington (bot) in branch '3.7':
      bpo-14117: Make minor tweaks to turtledemo (GH-8002)
      e2c5a75

    16. miss-islington commented on Jun 29, 2018

      @miss-islington
      Contributor

      New changeset 00e0524 by Miss Islington (bot) in branch '3.6':
      bpo-14117: Make minor tweaks to turtledemo (GH-8002)
      00e0524

    17. vstinner commented on Oct 24, 2018

      @vstinner
      Member

      See also bpo-35039 which removed now useless clock() calls from Lib/turtledemo/penrose.py.

    18. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of life3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions