sphinx-doc / sphinx-doc/sphinx

Gettext builder not extracting content of doctest blocks

Open
#12,871 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting:review builder:gettext docutils i18n type:bug
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Hi, running a gettext builder on a documents with doctest-block in gettext_additional_targets doesn't add the content of doctest blocks in generated POTs.

How to Reproduce
  1. Add doctest-block to gettext_additional_targets in conf.py
    (https://github.com/python/cpython/pull/123852).

  2. Run % make gettext.

  3. -> lack of expected doctest blocks in POTs, example one: https://github.com/python/cpython/blob/be90648fb2de58b148dcc7553a08ca646911baf2/Doc/tutorial/introduction.rst?plain=1#L150-L155

Environment Information

Sphinx version: v7.3.7

Additional context

From a quick look I'm not able to figure out the cause in the Sphinx codebase.

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.

Research direction

Reproduce the issue by adding doctest-block to gettext_additional_targets in conf.py and running make gettext. Trace the gettext builder's handling of that target and compare the generated POT with the doctest content in Doc/tutorial/introduction.rst; done means doctest blocks are included and a regression test covers the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.