cpython
cpython copied to clipboard
Python 3.10.7 Docs fails with Sphinx 5.3.0
Noticed that here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:L/python310:doc/standard/x86_64
[ 32s] + /usr/bin/make -O -j8 V=1 VERBOSE=1 -j1 html
[ 32s] mkdir -p build
[ 32s] Using existing Misc/NEWS file
[ 32s] PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -j auto -W . build/html
[ 33s] Running Sphinx v5.3.0
[ 33s] making output directory... done
[ 33s] building [mo]: targets for 0 po files that are out of date
[ 33s] building [html]: targets for 487 source files that are out of date
[ 34s] updating environment: [new config] 487 added, 0 changed, 0 removed
[ 34s]
[ 34s] Sphinx parallel build error:
[ 34s] KeyError: 'sphinx'
The problematic line:
395 label = translators['sphinx'].gettext(label)
If I print the content of translators I get:
{('console', 'sphinx'): <gettext.NullTranslations object at 0x7ffff7664eb0>, ('general', 'sphinx'): <gettext.NullTranslations object at 0x7ffff6113cd0>, ('general', 'sphinxcontrib.applehelp'): <gettext.NullTranslations object at 0x7ffff5620910>, ('console', 'sphinxcontrib.applehelp'): <gettext.NullTranslations object at 0x7ffff56209d0>, ('general', 'sphinxcontrib.devhelp'): <gettext.NullTranslations object at 0x7ffff5622d40>, ('console', 'sphinxcontrib.devhelp'): <gettext.NullTranslations object at 0x7ffff5623e20>, ('general', 'sphinxcontrib.htmlhelp'): <gettext.NullTranslations object at 0x7ffff5623f10>, ('console', 'sphinxcontrib.htmlhelp'): <gettext.NullTranslations object at 0x7ffff5623f40>, ('general', 'sphinxcontrib.serializinghtml'): <gettext.NullTranslations object at 0x7ffff564ceb0>, ('console', 'sphinxcontrib.serializinghtml'): <gettext.NullTranslations object at 0x7ffff564cf10>, ('general', 'sphinxcontrib.qthelp'): <gettext.NullTranslations object at 0x7ffff564cfa0>, ('console', 'sphinxcontrib.qthelp'): <gettext.NullTranslations object at 0x7ffff564d630>, ('general', 'about'): <gettext.NullTranslations object at 0x7ffff56a2830>, ('general', 'bugs'): <gettext.NullTranslations object at 0x7ffff56a3790>, ('general', 'c-api'): <gettext.NullTranslations object at 0x7ffff536a800>}
@AA-Turner
- PR: gh-99358
- PR: gh-99359
CCing the hunk author: @zooba.
This issue is also observed in the python-docs-zh-tw's CI jobs for building the translated Python 3.11 doc. Here is the sample GitHub Action log.
sphinx.locale.translators is originally a defaultdict(gettext.NullTranslations) but changed to a dict in this commit. Modify pyspecific.py's translators['sphinx'] (3 occurrences) to translators[('general', 'sphinx')] should probably solve the issue?
Modify pyspecific.py's
translators['sphinx'](3 occurrences) totranslators[('general', 'sphinx')]should probably solve the issue?
Great you found the commit which caused that. Can you please create a pull request that will make the change?
I believe sphinx.locale._ could be used to the same effect, which is backwards compatible.
A
Thanks for fixing this!