This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pyspecific.py > AuditEvent mess with translations
Type: Stage: patch review
Components: Documentation Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, mdk, steve.dower
Priority: normal Keywords: patch

Created on 2021-03-20 16:26 by mdk, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 24945 closed mdk, 2021-03-20 17:30
Messages (1)
msg389169 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2021-03-20 16:26
In case an `.. audit-event::` has a content, Sphinx gets confused:

It will provide both "auto-generated" and the content in po files, for interactivehook for example we have:

    #: library/sys.rst:953
    msgid ""
    "Raises an :ref:`auditing event <auditing>` ``cpython.run_interactivehook`` "
    "with argument ``hook``."
    msgstr ""

    #: library/sys.rst:955
    msgid ""
    "Raises an :ref:`auditing event <auditing>` ``cpython.run_interactivehook`` "
    "with the hook object as the argument when the hook is called on startup."
    msgstr ""
    "Lève un :ref:`évènement d'audit <auditing>` ``cpython.run_interactivehook`` "
    "avec l'objet de point d'entrée comme argument lorsqu'il est appelé au "
    "démarrage."

Which is not needed as only the content is used to render the doc, but it's the least issue. The issue is that Sphinx will then check the used one (content) against the translation of the auto-generated one leading it to trigger a warning on case the :ref: used don't match, typically for:


    .. audit-event:: sys.unraisablehook hook,unraisable sys.unraisablehook

       Raise an auditing event ``sys.unraisablehook`` with arguments
       ``hook``, ``unraisable`` when an exception that cannot be handled occurs.
       The ``unraisable`` object is the same as what will be passed to the hook.
       If no hook has been set, ``hook`` may be ``None``.

    
Sphinx will compare the auto-generated one:

    Raises an :ref:`auditing event <auditing>` ``sys.unraisablehook`` with arguments ``hook``, ``unraisable``.

Against our translated one (Lève un évènement d'audit ...).

Issue is, as in "Raise an auditing event" there's no :ref:, but as we translated "Raises an :ref:`auditing event <auditing>`" we used one, Sphinx whines about inconsistent term references.

As far as I understand it, it's related, or near, the:

    if self.content:
        self.state.nested_parse(self.content, self.content_offset, pnode)
    else:
        n, m = self.state.inline_text(text, self.lineno)
        pnode.extend(n + m)

part of pyspecific.py.
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87736
2021-03-20 17:30:53mdksetkeywords: + patch
stage: patch review
pull_requests: + pull_request23704
2021-03-20 16:26:35mdkcreate