From 74036e55f32123e63f85e7860817b485c89f2a73 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 16 Nov 2025 15:00:55 -0800 Subject: [PATCH 1/3] [cleanup] Remove unused `idlelib.editor._sphinx_version()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `_sphinx_version()` function is no longer needed since CHM (Compiled HTML Help) documentation files are no longer installed. This removes the dead code as indicated by the TODO comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Lib/idlelib/editor.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 83112d85575e47..5489a94dc9403e 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -35,18 +35,6 @@ TK_TABWIDTH_DEFAULT = 8 darwin = sys.platform == 'darwin' -def _sphinx_version(): - "Format sys.version_info to produce the Sphinx version string used to install the chm docs" - major, minor, micro, level, serial = sys.version_info - # TODO remove unneeded function since .chm no longer installed - release = f'{major}{minor}' - release += f'{micro}' - if level == 'candidate': - release += f'rc{serial}' - elif level != 'final': - release += f'{level[0]}{serial}' - return release - class EditorWindow: from idlelib.percolator import Percolator From 2e6f6dffc3aaab5d18a7a528ef02ad748cf897d7 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 16 Nov 2025 15:28:25 -0800 Subject: [PATCH 2/3] gh-91242: Remove CHM (Compiled HTML Help) build infrastructure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove all CHM compilation infrastructure to complete the deprecation that began in August 2022. CHM format documentation is now obsolete and has been replaced by HTML documentation. Changes: - Doc/: Remove CHM compilation from make.bat, remove htmlhelp config from conf.py, update Makefile and README.rst to remove CHM references - PC/layout/: Remove CHM file copying, constants, options, and manifest entries from the Windows package layout system - Tools/msi/: Remove CHM support from MSI installer build and upload scripts The htmlhelp build target is retained as it remains useful for generating HTML Help format files without CHM compilation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Doc/Makefile | 3 +-- Doc/README.rst | 9 ++------- Doc/conf.py | 10 ---------- Doc/make.bat | 23 ----------------------- PC/layout/main.py | 4 ---- PC/layout/support/appxmanifest.py | 4 ---- PC/layout/support/constants.py | 4 ---- PC/layout/support/options.py | 1 - PC/layout/support/pymanager.py | 9 --------- Tools/msi/get_externals.bat | 1 - Tools/msi/msi.props | 1 - Tools/msi/uploadrelease.proj | 3 --- Tools/msi/uploadrelease.ps1 | 19 +------------------ 13 files changed, 4 insertions(+), 87 deletions(-) diff --git a/Doc/Makefile b/Doc/Makefile index f16d9cacb1b6fb..7632a5805417b7 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -84,8 +84,7 @@ html: build .PHONY: htmlhelp htmlhelp: BUILDER = htmlhelp htmlhelp: build - @echo "Build finished; now you can run HTML Help Workshop with the" \ - "build/htmlhelp/pydoc.hhp project file." + @echo "Build finished. The HTML Help files are in build/htmlhelp." .PHONY: latex latex: BUILDER = latex diff --git a/Doc/README.rst b/Doc/README.rst index 2d1148753e0c6b..887cdfafc6fee0 100644 --- a/Doc/README.rst +++ b/Doc/README.rst @@ -66,13 +66,8 @@ Available make targets are: starts a local server, and automatically reloads the page in your browser when you make changes to reST files (Unix only). -* "htmlhelp", which builds HTML files and a HTML Help project file usable to - convert them into a single Compiled HTML (.chm) file -- these are popular - under Microsoft Windows, but very handy on every platform. - - To create the CHM file, you need to run the Microsoft HTML Help Workshop - over the generated project (.hhp) file. The ``make.bat`` script does this for - you on Windows. +* "htmlhelp", which builds HTML files in HTML Help format -- this format + is useful on every platform. * "latex", which builds LaTeX source files as input to ``pdflatex`` to produce PDF documents. diff --git a/Doc/conf.py b/Doc/conf.py index 0f1412d1007dc2..92375b4b2096a7 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -278,13 +278,6 @@ 'Read the Docs' ) -# Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207 -# https://github.com/python/cpython/issues/91207 -if any('htmlhelp' in arg for arg in sys.argv): - html_style = 'pydoctheme.css' - print("\nWARNING: Windows CHM Help is no longer supported.") - print("It may be removed in the future\n") - # Short title used e.g. for HTML tags. html_short_title = f'{release} Documentation' @@ -327,9 +320,6 @@ # Additional static files. html_static_path = ['_static', 'tools/static'] -# Output file base name for HTML help builder. -htmlhelp_basename = 'python' + release.replace('.', '') - # Split the index html_split_index = True diff --git a/Doc/make.bat b/Doc/make.bat index 99f0d5c44f0098..4f6afd49ac35a7 100644 --- a/Doc/make.bat +++ b/Doc/make.bat @@ -48,23 +48,6 @@ if not defined SPHINXLINT ( set SPHINXLINT=%PYTHON% -m sphinxlint ) -if "%1" NEQ "htmlhelp" goto :skiphhcsearch -if exist "%HTMLHELP%" goto :skiphhcsearch - -rem Search for HHC in likely places -set HTMLHELP= -where hhc /q && set "HTMLHELP=hhc" && goto :skiphhcsearch -where /R ..\externals hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc" -if not exist "%HTMLHELP%" where /R "%ProgramFiles(x86)%" hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc" -if not exist "%HTMLHELP%" where /R "%ProgramFiles%" hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc" -if not exist "%HTMLHELP%" ( - echo. - echo.The HTML Help Workshop was not found. Set the HTMLHELP variable - echo.to the path to hhc.exe or download and install it from - echo.http://msdn.microsoft.com/en-us/library/ms669985 - exit /B 1 -) -:skiphhcsearch if not defined DISTVERSION for /f "usebackq" %%v in (`%PYTHON% tools/extensions/patchlevel.py`) do set DISTVERSION=%%v @@ -149,12 +132,6 @@ if "%1" EQU "htmlhelp" ( ) cmd /S /C "%SPHINXBUILD% %SPHINXOPTS% --builder %1 --doctree-dir build\doctrees . "%BUILDDIR%\%1" %2 %3 %4 %5 %6 %7 %8 %9" -if "%1" EQU "htmlhelp" ( - "%HTMLHELP%" "%BUILDDIR%\htmlhelp\python%DISTVERSION:.=%.hhp" - rem hhc.exe seems to always exit with code 1, reset to 0 for less than 2 - if not errorlevel 2 cmd /C exit /b 0 -) - echo. if errorlevel 1 ( echo.Build failed (exit code %ERRORLEVEL%^), check for error messages diff --git a/PC/layout/main.py b/PC/layout/main.py index 8543e7c56e1c41..cb3f9f6f1c5641 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -291,10 +291,6 @@ def _c(d): continue yield dest, src - if ns.include_chm: - for dest, src in rglob(ns.doc_build / "htmlhelp", PYTHON_CHM_NAME): - yield "Doc/{}".format(dest), src - if ns.include_html_doc: for dest, src in rglob(ns.doc_build / "html", "**/*"): yield "Doc/html/{}".format(dest), src diff --git a/PC/layout/support/appxmanifest.py b/PC/layout/support/appxmanifest.py index 53977beb8af834..30a8ca86eb5770 100644 --- a/PC/layout/support/appxmanifest.py +++ b/PC/layout/support/appxmanifest.py @@ -171,10 +171,6 @@ ), }, "Help": { - "Main Python Documentation": { - "_condition": lambda ns: ns.include_chm, - "": "[{{AppVPackageRoot}}]\\Doc\\{}".format(PYTHON_CHM_NAME), - }, "Local Python Documentation": { "_condition": lambda ns: ns.include_html_doc, "": "[{AppVPackageRoot}]\\Doc\\html\\index.html", diff --git a/PC/layout/support/constants.py b/PC/layout/support/constants.py index 6b8c915e519743..8ff422fa58ad15 100644 --- a/PC/layout/support/constants.py +++ b/PC/layout/support/constants.py @@ -77,9 +77,5 @@ def check_patchlevel_version(sources): PYTHON_ZIP_NAME = "python{}{}.zip".format(VER_MAJOR, VER_MINOR) PYTHON_PTH_NAME = "python{}{}._pth".format(VER_MAJOR, VER_MINOR) -PYTHON_CHM_NAME = "python{}{}{}{}.chm".format( - VER_MAJOR, VER_MINOR, VER_MICRO, VER_SUFFIX -) - FREETHREADED_PYTHON_DLL_NAME = "python{}{}t.dll".format(VER_MAJOR, VER_MINOR) FREETHREADED_PYTHON_STABLE_DLL_NAME = "python{}t.dll".format(VER_MAJOR) diff --git a/PC/layout/support/options.py b/PC/layout/support/options.py index e8c393385425e7..4aeef78938e8df 100644 --- a/PC/layout/support/options.py +++ b/PC/layout/support/options.py @@ -30,7 +30,6 @@ def public(f): "appxmanifest": {"help": "an appxmanifest"}, "props": {"help": "a python.props file"}, "nuspec": {"help": "a python.nuspec file"}, - "chm": {"help": "the CHM documentation"}, "html-doc": {"help": "the HTML documentation"}, "freethreaded": {"help": "freethreaded binaries", "not-in-all": True}, "alias": {"help": "aliased python.exe entry-point binaries"}, diff --git a/PC/layout/support/pymanager.py b/PC/layout/support/pymanager.py index 831d49ea3f9b46..611c10c0c572a9 100644 --- a/PC/layout/support/pymanager.py +++ b/PC/layout/support/pymanager.py @@ -219,15 +219,6 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False): "Name": f"{DISPLAY_NAME} {VER_DOT} Manuals{DISPLAY_SUFFIX}", "Target": r"%PREFIX%Doc\html\index.html", }) - elif ns.include_chm: - STD_PEP514[0]["Help"]["Main Python Documentation"] = { - "_": rf"%PREFIX%Doc\{PYTHON_CHM_NAME}", - } - STD_START[0]["Items"].append({ - "Name": f"{DISPLAY_NAME} {VER_DOT} Manuals{DISPLAY_SUFFIX}", - "Target": "%WINDIR%hhc.exe", - "Arguments": rf"%PREFIX%Doc\{PYTHON_CHM_NAME}", - }) STD_UNINSTALL.append({ "kind": "uninstall", diff --git a/Tools/msi/get_externals.bat b/Tools/msi/get_externals.bat index f6602ce9588ff4..deb2884b84ca44 100644 --- a/Tools/msi/get_externals.bat +++ b/Tools/msi/get_externals.bat @@ -53,7 +53,6 @@ set binaries= rem We always use whatever's latest in the repo for these set binaries=%binaries% binutils set binaries=%binaries% gpg -set binaries=%binaries% htmlhelp set binaries=%binaries% nuget set binaries=%binaries% redist-1 set binaries=%binaries% wix-314 diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props index 372c4823bce07f..98a8f32a3e9464 100644 --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -59,7 +59,6 @@ <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist-1\$(Platform)</CRTRedist> <CRTRedist>$([System.IO.Path]::GetFullPath($(CRTRedist)))</CRTRedist> <TclTkLibraryDir Condition="$(TclTkLibraryDir) == ''">$(tcltkDir)lib</TclTkLibraryDir> - <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename> <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion> </PropertyGroup> diff --git a/Tools/msi/uploadrelease.proj b/Tools/msi/uploadrelease.proj index e70ae1de22fa78..97b0ad69f069c5 100644 --- a/Tools/msi/uploadrelease.proj +++ b/Tools/msi/uploadrelease.proj @@ -27,9 +27,6 @@ <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip"> <CopyTo>$(EXETarget)</CopyTo> </File> - <File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)"> - <CopyTo>$(EXETarget)</CopyTo> - </File> </ItemGroup> <Target Name="_ValidateProperties"> diff --git a/Tools/msi/uploadrelease.ps1 b/Tools/msi/uploadrelease.ps1 index a8669e5d65ed14..44473fb4b23d7f 100644 --- a/Tools/msi/uploadrelease.ps1 +++ b/Tools/msi/uploadrelease.ps1 @@ -15,8 +15,6 @@ The subdirectory on the host to copy files to. .Parameter tests The path to run download tests in. -.Parameter doc_htmlhelp - Optional path besides -build to locate CHM files. .Parameter embed Optional path besides -build to locate ZIP files. .Parameter skipupload @@ -34,7 +32,6 @@ param( [string]$server="python-downloads", [string]$target="/srv/www.python.org/ftp/python", [string]$tests=${env:TEMP}, - [string]$doc_htmlhelp=$null, [string]$embed=$null, [switch]$skipupload, [switch]$skippurge, @@ -79,20 +76,10 @@ if (-not $skipupload) { "Upload using $pscp and $plink" "" - if ($doc_htmlhelp) { - $chm = gci -EA 0 $doc_htmlhelp\python*.chm, $doc_htmlhelp\python*.chm.asc - } else { - $chm = gci -EA 0 $build\python*.chm, $build\python*.chm.asc - } - $d = "$target/$($p[0])/" & $plink -batch $user@$server mkdir $d & $plink -batch $user@$server chgrp downloads $d & $plink -batch $user@$server chmod o+rx $d - if ($chm) { - & $pscp -batch $chm.FullName "$user@${server}:$d" - if (-not $?) { throw "Failed to upload $chm" } - } $dirs = gci "$build" -Directory if ($embed) { @@ -151,11 +138,7 @@ if (-not $skiptest) { if (-not $skiphash) { # Display MD5 hash and size of each downloadable file pushd $build - $files = gci python*.chm, *\*.exe, *\*.zip - if ($doc_htmlhelp) { - cd $doc_htmlhelp - $files = ($files, (gci python*.chm)) | %{ $_ } - } + $files = gci *\*.exe, *\*.zip if ($embed) { cd $embed $files = ($files, (gci *.zip)) | %{ $_ } From 13d562e2106b0841c9fa7b0ee95549845dc86708 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" <greg@krypto.org> Date: Sun, 16 Nov 2025 19:08:27 -0800 Subject: [PATCH 3/3] Adopt additional IDLE help file changes from #140418 Remove PDF and CHM references from IDLE help file browser and config. Co-Authored-By: Claude <noreply@anthropic.com> --- Lib/idlelib/config-main.def | 5 ++--- Lib/idlelib/query.py | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/idlelib/config-main.def b/Lib/idlelib/config-main.def index 28ae94161d5c03..54bdce34af31e0 100644 --- a/Lib/idlelib/config-main.def +++ b/Lib/idlelib/config-main.def @@ -34,9 +34,8 @@ # relevant settings from the default file. # # Additional help sources are listed in the [HelpFiles] section below -# and should be viewable by a web browser (or the Windows Help viewer in -# the case of .chm files). These sources will be listed on the Help -# menu. The pattern, and two examples, are: +# and should be viewable by a web browser. These sources will be listed +# on the Help menu. The pattern, and two examples, are: # # <sequence_number = menu item;/path/to/help/source> # 1 = IDLE;C:/Programs/Python36/Lib/idlelib/help.html diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py index 57230e2aaca66d..5f9bdc031e544b 100644 --- a/Lib/idlelib/query.py +++ b/Lib/idlelib/query.py @@ -289,8 +289,6 @@ def askfilename(self, filetypes, initdir, initfile): # htest # def browse_file(self): filetypes = [ ("HTML Files", "*.htm *.html", "TEXT"), - ("PDF Files", "*.pdf", "TEXT"), - ("Windows Help Files", "*.chm"), ("Text Files", "*.txt", "TEXT"), ("All Files", "*")] path = self.pathvar.get()