Skip to content

gh-151949: Fix Sphinx reference warnings in Doc/library/lzma.rst#153878

Open
fedonman wants to merge 2 commits into
python:mainfrom
fedonman:fix-gh-151949-lzma-sphinx-warnings
Open

gh-151949: Fix Sphinx reference warnings in Doc/library/lzma.rst#153878
fedonman wants to merge 2 commits into
python:mainfrom
fedonman:fix-gh-151949-lzma-sphinx-warnings

Conversation

@fedonman

@fedonman fedonman commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

The lzma module constants (FORMAT_*, CHECK_*, PRESET_*, the FILTER_* names, MODE_* and MF_*) were referenced with the :const: role all over Doc/library/lzma.rst, but none of them were actually defined as reference targets. In nitpicky mode this produced 35 "py:const reference target not found" warnings (the full list is in the issue).

This documents those constants with .. data:: directives, the same way signal, socket and ssl already do it, so the existing :const: references resolve to real linked entries. The inline descriptions of the format and check constants in LZMACompressor become short linked references, and their full descriptions now live in the new Constants section. The BCJ filter references that are deliberately suppressed (like FILTER_X86) are left alone, since they don't emit warnings.

I checked with a nitpicky docs build (sphinx-build -n -D nitpicky=1): all 35 warnings from lzma.rst are gone and no new ones appear.

Sub-issue of #151940.

The lzma module constants (FORMAT_*, CHECK_*, PRESET_*, FILTER_*, MODE_*
and MF_*) were referenced with the :const: role throughout the module
documentation but were never defined as reference targets, producing
"reference target not found" warnings under nitpicky mode.

Document these public constants with .. data:: directives, following the
convention used by the signal, socket and ssl modules, so the existing
references resolve. The now-redundant inline descriptions of the format
and check constants are condensed into linked references.
@read-the-docs-community

read-the-docs-community Bot commented Jul 18, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33644845 | 📁 Comparing a55297b against main (16d0c89)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant