Skip to content

Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?) #84232

Closed

Description

@wyz23x2
mannequin
BPO 40051
Nosy @smontanaro, @terryjreedy, @merwok, @bitdancer, @vadmium, @zware, @wyz23x2, @Joshuah143
PRs
  • gh-84232: Fix doc links in module help() output #29419
  • General cleanup of test_pydoc #29459
  • 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 = None
    closed_at = None
    created_at = <Date 2020-03-24.05:06:25.977>
    labels = ['type-bug', 'library', '3.11']
    title = 'Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?)'
    updated_at = <Date 2021-11-08.03:08:11.097>
    user = 'https://github.com/wyz23x2'

    bugs.python.org fields:

    activity = <Date 2021-11-08.03:08:11.097>
    actor = 'eric.araujo'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-03-24.05:06:25.977>
    creator = 'wyz23x2'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40051
    keywords = ['patch']
    message_count = 15.0
    messages = ['364917', '365232', '365246', '368021', '368044', '368102', '374998', '404542', '404545', '404825', '405765', '405767', '405768', '405922', '405923']
    nosy_count = 9.0
    nosy_names = ['skip.montanaro', 'terry.reedy', 'eric.araujo', 'r.david.murray', 'docs@python', 'martin.panter', 'zach.ware', 'wyz23x2', 'Joshuah143']
    pr_nums = ['29419', '29459']
    priority = 'normal'
    resolution = None
    stage = 'test needed'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40051'
    versions = ['Python 3.11']

    Linked PRs

    Activity

    1. added
      3.9 (EOL)
      and removed on Mar 28, 2020
    2. changed the title [-]Dead link in help(lib2to3)[/-] [+]Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)[/+] on Mar 28, 2020
    3. added
      type-bug
      3.7 (EOL)
      3.9 (EOL)
      and removed
      performance
      on Mar 28, 2020
    4. changed the title [-]Dead link in help(lib2to3)[/-] [+]Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)[/+] on Mar 28, 2020
    5. added
      type-bug
      and removed
      performance
      on Mar 28, 2020
    6. wyz23x2 commented on Mar 29, 2020

      wyz23x2mannequin
      MannequinAuthor

      My opinion:
      I think No.2 makes more sense to users that visit the docs directly by https://docs.python.org/3.8/library/lib2to3.html; they will copy the "docs.python.org/version/library/modulename.html" format from other modules. But I also agree it's fragile.
      No.3 is good too, according to me. Can use it if No.2 is too fragile.

    7. wyz23x2 commented on May 4, 2020

      wyz23x2mannequin
      MannequinAuthor

      Patch?

    8. terryjreedy commented on May 4, 2020

      @terryjreedy
      Member

      Not until decision made. And not be me until I have my development machine running.

    9. wyz23x2 commented on May 5, 2020

      wyz23x2mannequin
      MannequinAuthor

      OK.

    10. wyz23x2 commented on Aug 7, 2020

      wyz23x2mannequin
      MannequinAuthor

      Ping? Which of the 3 should we choose?

    11. added
      3.10 (EOL)
      and removed
      3.7 (EOL)
      on Aug 7, 2020
    12. added and removed
      docs
      stdlib
      on Oct 20, 2021
    13. zware commented on Oct 20, 2021

      @zware
      Member

      This one got caught up in the purge of 2to3 issues, but it's about more than just 2to3. Reopening.

    14. added
      3.11
      docs
      stdlib
      and removed
      3.8 (EOL)
      on Oct 20, 2021
    15. changed the title [-]Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)[/-] [+]Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?)[/+] on Oct 20, 2021
    16. reopened this on Oct 20, 2021
    17. changed the title [-]Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)[/-] [+]Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?)[/+] on Oct 20, 2021
    18. reopened this on Oct 20, 2021
    19. terryjreedy commented on Oct 20, 2021

      @terryjreedy
      Member

      As the title suggested, this is a generic help(module) issue that involves several library modules, including idlelib. It just happened to be reported for 2to3. For example, the generated text for
      import idlelib; help(idlelib)
      includes
      MODULE REFERENCE
      https://docs.python.org/3.11/library/idlelib.html
      It should be .../idle.html.

      The holdup is that I was not then willing to unilaterally decide which of the 3 possible solutions I listed should be pursued. Maybe just 3, maybe a mix of 1 and 3.

    20. removed
      3.9 (EOL)
      3.10 (EOL)
      docs
      on Oct 20, 2021
    21. changed the title [-]Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?)[/-] [+]Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?)[/+] on Oct 20, 2021
    22. removed
      3.10 (EOL)
      docs
      on Oct 20, 2021
    23. changed the title [-]Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?)[/-] [+]Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?)[/+] on Oct 20, 2021
    24. merwok commented on Oct 22, 2021

      @merwok
      Member

      Option 3 seems simple and ok to me.

    25. zware commented on Nov 5, 2021

      @zware
      Member

      Option 4: generate a list of modules (or a mapping of module names to documentation files) that have documentation when generating Lib/pydoc_data/topics.py, and teach pydoc.help to not include the link when it knows the module doesn't have documentation.

      This is a much more complete solution that also avoids creating links for private modules (see bpo-45717), but is significantly more effort to implement.

    26. Joshuah143 commented on Nov 5, 2021

      Joshuah143mannequin
      Mannequin

      I think that option 4 would work best but instead of putting any logic in (Lib/pydoc_data/topics.py)[https://github.com/python/cpython/blob/main/Lib/pydoc_data/topics.py] we could put the logic for working with private modules as well and other edge cases in (Lib/pydoc.py)[https://github.com/python/cpython/blob/main/Lib/pydoc.py]. It might make future changes easier.

    27. zware commented on Nov 5, 2021

      @zware
      Member

      This actually turned out to be less effort than I expected (though I still should have been asleep 2 hours ago), so I've gone ahead and opened #29419 to implement what I suggested.

    28. terryjreedy commented on Nov 8, 2021

      @terryjreedy
      Member

      PR-29419 solves the issue in bpo-45717 of not giving a link for _* modules with no doc. It does not solve this issue of giving the proper link for module that need non-standard links, which typically need a '#' suffix, as in '.../library/2to3.html#module-lib2to3'. I suggest to continue calculating standard links as done now as the precalculation needs much space for a trivial time saving. Restrict the new dict to non-standard links. They can be calculated, with the needed suffixes, as they are now for the index. The link logic would be to try the lookup first and if module name does not start with '_', calculate the link.

      I will add an idlelib section to idle.rst so that 'idlelib' appears in the module index and get entered into the exceptions dict.

      I don't see how PR-29459 get linked here as it has no reference to this issue. So I will ignore it at least for know.

    29. merwok commented on Nov 8, 2021

      @merwok
      Member

      I think that second PR was linked using the GitHub PR link field present in the bug comment form.

    30. transferred this issue fromon Apr 10, 2022
    31. added 3 commits that reference this issue on Sep 27, 2024
    32. removed
      3.11
      on Mar 4, 2025
    33. added
      3.13
      3.14
      3.15
      on Dec 15, 2025
    34. added a commit that references this issue on Dec 23, 2025
    35. merwok commented on Dec 23, 2025

      @merwok
      Member

      @StanFromIreland @hugovk Shouldn’t this be backported to bugfix branches?

      (On the PR, I said I didn’t add the backports labels because manual backports were needed, not because there shouldn’t be backports)

    36. added
      needs backport to 3.13
      needs backport to 3.14
      and removed
      needs backport to 3.13
      needs backport to 3.14
      on Dec 23, 2025
    37. added a commit that references this issue on Dec 23, 2025
    38. added 3 commits that reference this issue on Dec 23, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.133.143.15stdlibtype-bug

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions