Repository navigation
Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?) #84232
Description
Activity
When typing this in shell: >>> import lib2to3 >>> help(lib2to3)
The output contains this link:
--snip--
MODULE REFERENCE
https://docs.python.org/3.8/library/lib2to3 <--The following documentation is automatically generated from the Python--snip--
But when you access it, 404!
This works:
https://docs.python.org/3.8/library/2to3.html#module-lib2to3Please change it. Thanks!
- addedperformancePerformance or resource usagePerformance or resource usagedocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory3.8 (EOL)end of lifeend of life
on Mar 24, 2020 - addedperformancePerformance or resource usagePerformance or resource usagedocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory3.8 (EOL)end of lifeend of life
on Mar 24, 2020 Lib/lib2to3 is a directory with __init__.py containing
### empty
Unlike most python-coded modules, there is no Doc/library/lib2to3.rst and hence no generated lib2to3.html. Instead, there is a 2to3.rst and 2to3.html. In the module index, module xyz is usually linked to .../library/xyz.html#module-xyz. But lib2to3 is somewhere linked instead to .../library/2to3.html#module-lib2to3.As implied by the changed title, this issue is not at all unique to lib2to3. Just as lib2to3 implements the command line app 2to3, with 2to3.rst, idlelib implements IDLE with idle.rst. Turtle demo is domumented within turtle.rst. Most tkinter submodule have no doc other than a mention within tkinter.rst. These could perhaps have a # module-tkinter.xyz target added. (I am not familiar with exactly how.) But there are also the numerous test modules that have no doc, and the generated doc for these is less useful than the code itself.
Possible solutions framed in terms of lib2to3:
-
Manual redirection: add lib2to3.rst and hence lib2to3.html with the correct url, possibly with additional text. But this is not the only module documented within a file with another name, and would not work for things like test files that should not be documented.
-
Auto redirection: persuade whoever manages docs.python.org to add
a redirection for lib2to3. Fragile. -
Hardcode the exception in the help output generation. The latter is generated by pydoc.help. The module doc location under MODULE REFERENCE is generated by pydoc.Doc.getdocloc. This function already has a couple of (probably obsolete) tuples of exceptions, so adding more seems OK.
The oddity is that .html is added if and only if the doc location does not start with 'http'. lines 414-417.I think that this is backwards. It only works because docs.python.org adds missing .html, even to "https://docs.python.org/3.8/library/2to3#module-lib2to3", which is why the bug? has not been noticed. Note that by default, docloc starts with 'https://', so by default, .html is omitted.
Skip, David, and Martin, you have all modified this part of the code. Do any of you disagree that there is a bug?
-
56 remaining items
- added3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes
on Dec 15, 2025 - added a commit that references this issue
on Dec 23, 2025 @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)
Reacted by Hugo van Kemenade- addedneeds backport to 3.13only security fixesonly security fixesneeds backport to 3.14bugs and security fixesbugs and security fixesand removedneeds backport to 3.13only security fixesonly security fixesneeds backport to 3.14bugs and security fixesbugs and security fixes
on Dec 23, 2025
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
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:
bugs.python.org fields:
Linked PRs
pydocdocs.python.org link generation #139995pydocdocs.python.org link generation (GH-139995) #143098pydocdocs.python.org link generation (GH-139995) #143099