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_*, FILTER_LZMA1/FILTER_LZMA2/FILTER_DELTA, MODE_* and MF_*) were referenced with the :const: role throughout Doc/library/lzma.rst, but none of them were ever defined as reference targets. Under nitpicky mode this produced 35 py:const reference target not found warnings (the full list is in the issue).

This documents those public constants with .. data:: directives — following the convention already used by signal, socket and ssl — so the existing :const: references resolve to real, linked entries. The now-redundant inline descriptions of the format and check constants in LZMACompressor are condensed into linked references, with their full descriptions living in the new Constants section. The deliberately suppressed BCJ filter references (:const:!FILTER_X86`` etc.) are left unchanged, as they do not emit warnings.

Verified with a nitpicky docs build (sphinx-build -n -D nitpicky=1): all 35 lzma.rst warnings are resolved and no new warnings are introduced.

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