python / python/cpython

Docs: C annotations extension produces invalid docutils tree

Open
#140,014 1 comment 0 reactions 1 assignee View on GitHub

@AA-Turner is already working on this.

Since Oct 12, 2025.

docs type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

The function add_annotations in Doc/tools/extensions/c_annotations.py inserts an emphasis node into a desc_content node. This produces an invalid document tree, since the desc_content node is a docutils Element and is not supposed to have children that are text or inline elements. To fix this, the emphasis node needs to be wrapped in a paragraph node.

[…] the validity of the docutils tree is not checked by docutils or Sphinx.

This prevents to build the documentation to PDF with rinohtype.

Linked PRs
  • gh-145838

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.