Skip to content

Unable to generate POT for Python documentation #104284

Closed
@rffontenelle

Description

@rffontenelle

Bug report

I coordinate Brazilian Portuguese translation of the Python documentation. As part of the translation update process, I run sphinx-build's gettext builder to generate POT (translation files template) and update translations.

Since 3 days ago I'm unable to successfully generate POT files because the gettext builder fails for me with the following output:

 ...
reading sources... [ 14%] distutils/apiref                                                                          
Exception occurred:
  File "/home/rffontenelle/cpython/Doc/venv/lib/python3.11/site-packages/sphinx/domains/python.py", line 1043, in run
    indextext = '%s; %s' % (pairindextypes['module'], modname)
                            ~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'module'
The full traceback has been saved in /tmp/sphinx-err-ds0bs43h.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:53: build] Error 2

The log file containing the full traceback: sphinx-err-ds0bs43h.log

This might be related to #104000.

Steps to reproduce:

  • cd cpython/Doc
  • git switch 3.11 # current target of translation efforts
  • make venv
  • make ALLSPHINXOPTS='-b gettext -d build/doctrees . locales/pot' build

Your environment

  • CPython versions tested on: 3.11 and 3.10
  • Operating system and architecture: Arch Linux x86_64 and Ubuntu 22.04 (GitHub runner image)
  • Packages installed by make venv: Jinja2-3.1.2 MarkupSafe-2.1.2 Pygments-2.15.1 alabaster-0.7.13 babel-2.12.1 blurb-1.1.0 certifi-2023.5.7 charset-normalizer-3.1.0 contourpy-1.0.7 cycler-0.11.0 docutils-0.17.1 fonttools-4.39.3 idna-3.4 imagesize-1.4.1 kiwisolver-1.4.4 matplotlib-3.7.1 numpy-1.24.3 packaging-23.1 pillow-9.5.0 polib-1.2.0 pyparsing-3.0.9 python-dateutil-2.8.2 python-docs-theme-2023.3.1 regex-2023.5.5 requests-2.30.0 six-1.16.0 snowballstemmer-2.2.0 sphinx-4.5.0 sphinx-lint-0.6.7 sphinxcontrib-applehelp-1.0.4 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.1 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 sphinxext-opengraph-0.8.2 urllib3-2.0.2

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions