Skip to content

Unable to translate parsed-literal block from using/mac.rst #135828

Closed

Description

@rffontenelle

Documentation

Two literal blocks from using/mac.rst's Installing using the command line section preceded by a parsed-literal directive can't be translated without having the Sphinx build triggering:

Lexing literal_block '<the whole block text in here>' as "python3" resulted in an error at token: '$'. Retrying in relaxed mode. [misc.highlighting_failure]

See this python-docs-pt-br's CI run for an example.

If I leave the translation empty or simply copy-and-paste the original string, this issue doesn't happen. Any other translation fails. For instance, translating a comment line like "download installer pkg" to "baixa o pkg do instalar" will fail.

Also, I noticed that the translated documentation has syntax highlight (colors and everthing) and a red rectangle around the $ signs, while the original documentation has no syntax highlight at all.

See screenshots taken just now of the published Brazilian Portuguese translation and the original:

Linked PRs

Activity

  1. LamentXU123 commented on Jun 23, 2025

    @LamentXU123
    Contributor

    Well I think its more like a Sphinx issue. CC @picnixz

  2. StanFromIreland commented on Jun 23, 2025

    @StanFromIreland
    Member

    This seems related to this old Sphinx issue: sphinx-doc/sphinx#2167

    But from the diff I can find no concrete reason why, except possibly not escaping \\ |version|\\ :

    "# download installer pkg\n"                                                                       |    "# baixa o pkg instalador\n"
    "curl -O \\https://www.python.org/ftp/python/\\ |version|\\ .0/${RELEASE}\n"                            "curl -O \\https://www.python.org/ftp/python/\\ |version|\\ .0/${RELEASE}\n"
    "\n"                                                                                                    "\n"
    "# create installer choicechanges to customize the install:\n"                                     |    "# cria choicechanges instalador para personalizar a instalação:\n"
    "#    enable the PythonTFramework-\\ |version|\\  package\n"                                       |    "#    habilita o pacote PythonTFramework-\\ |version|\n"
    "#    while accepting the other defaults (install all other packages)\n"                           |    "#    enquanto aceita outros padrões (instala todos os outros pacotes)\n"

    I propose we remove all parsed literals, they seem to not add anything and there are only a few:

    Doc/license.rst:.. parsed-literal::
    Doc/license.rst:.. parsed-literal::
    Doc/license.rst:.. parsed-literal::
    Doc/license.rst:.. parsed-literal::
    Doc/license.rst:.. parsed-literal::
    Doc/using/mac.rst:    .. parsed-literal::
    Doc/using/mac.rst:  .. parsed-literal::
    Doc/using/mac.rst:  .. parsed-literal::
    Doc/using/mac.rst:  .. parsed-literal::
    Doc/using/mac.rst:  .. parsed-literal::
    Doc/using/mac.rst:.. parsed-literal::
    Doc/using/mac.rst:.. parsed-literal::
    
  3. ned-deily commented on Jun 26, 2025

    @ned-deily
    Member

    FWIW, the use of parsed-literal was recently added to Doc/using/mac.rst replacing code-block's. The discussion of why this was done is in #130400.

  4. Taeknology commented on Jul 29, 2026

    @Taeknology
    Contributor

    PR #150074 proposes a fix for this issue and has been awaiting review since May. All checks are passing. Could someone take a look when available?

  5. added a commit that references this issue on Jul 30, 2026
  6. added 3 commits that reference this issue on Jul 30, 2026
  7. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions