Title: library/functions.rst causes translated builds to fail
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, humitos, mdk, rffontenelle
Priority: normal Keywords: patch

Created on 2020-01-06 05:38 by rffontenelle, last changed 2020-06-14 16:03 by humitos.

Pull Requests
URL Status Linked Edit
PR 17857 open rffontenelle, 2020-01-06 05:41
Messages (4)
msg359401 - (view) Author: Rafael Fontenelle (rffontenelle) * Date: 2020-01-06 05:38
Documentation file library/functions.rst has a syntax issue that when building documentation with warnings as errors, the following message appears:

cpython/Doc/library/functions.rst:: WARNING: inconsistent term references in translated message. original: [], translated: [':ref:`evento de auditoria <auditing>`']

After several testing, it seems that what is causing this is librar/functions.rst's line 795 not having a reference ":ref:`auditing event <auditing>`".

Steps to reproduce the issue:

1. git clone --depth 1

2. mkdir -p locale/pt_BR/LC_MESSAGES
3. git clone --depth 1 locale/pt_BR/LC_MESSAGES

4. cd locale/pt_BR/LC_MESSAGES

# This takes about 40 minutes (can be ignored for outdated po files with more unrelated syntax errors) 
5. tx pull --force --language pt_BR --parallel

6. cd ../../..

7. cd cpython/Doc/

8. make venv

9. make html                                \
    SPHINXOPTS='-q --keep-going -jauto      \
        -D locale_dirs=../../locale         \
        -D language=pt_BR                   \
        -D gettext_compact=0                \
        -D latex_engine=xelatex             \
        -D latex_elements.inputenc=         \
        -D latex_elements.fontenc='

10. Look for library/functions.rst "WARNING" error message between the output.
msg359558 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2020-01-07 22:41
I've already seen Sphinx giving inconsistent warnings about inconsistent terms references, see

I would recommand fixing all other warnings in the file first, then tell us how it goes.
msg359624 - (view) Author: Rafael Fontenelle (rffontenelle) * Date: 2020-01-08 18:57
Hey Julien! I already fixed once, now I fixed them again, but the message persists:

make[1]: Entering directory '/home/rffontenelle/repos/python-docs-pt-br/venv/workdirs/cpython/Doc'
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=/home/rffontenelle/repos/python-docs-pt-br/venv/workdirs/cpython/Doc/venv/bin:$PATH sphinx-build -b html -d build/doctrees  -q --keep-going -jauto   \
	-D locale_dirs=/home/rffontenelle/repos/python-docs-pt-br/venv/workdirs/locale        \
	-D language=pt_BR             \
	-D gettext_compact=0                \
	-D latex_engine=xelatex             \
	-D latex_elements.inputenc=         \
	-D latex_elements.fontenc= -W . build/html 
/home/rffontenelle/repos/python-docs-pt-br/venv/workdirs/cpython/Doc/library/functions.rst:: WARNING: inconsistent term references in translated message. original: [], translated: [':ref:`evento de auditoria <auditing>`']
make[1]: *** [Makefile:51: build] Error 1
make[1]: Leaving directory '/home/rffontenelle/repos/python-docs-pt-br/venv/workdirs/cpython/Doc'
msg371507 - (view) Author: Manuel Kaufmann (humitos) * Date: 2020-06-14 16:03
We are having a similar issue in python-docs-es translation.

cpython/Doc/library/ctypes.rst:: WARNING: inconsistent term references in translated message. original: [], translated: [':ref:`evento de auditoría <auditing>`']

Note that the WARNING does not mention a line number in the RST file. From what I could find, this is because the source English sentence is not in the .rst file, but it's a RST directive and the sentence comes from Python code:

The original RST file, uses the directive here:

The PO file we are translating, does not have a header with line numbers for this paragraph:
Date User Action Args
2020-06-14 16:03:51humitossetnosy: + humitos
messages: + msg371507
2020-01-08 18:57:12rffontenellesetmessages: + msg359624
2020-01-07 22:41:17mdksetmessages: + msg359558
2020-01-06 06:07:56xtreaksetnosy: + mdk
2020-01-06 05:41:15rffontenellesetkeywords: + patch
stage: patch review
pull_requests: + pull_request17277
2020-01-06 05:38:30rffontenellecreate