`pospell` fails with code entries · Issue #3324 · python/python-docs-es · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

pospell fails with code entries #3324

Open
@cmaureir

Description

@cmaureir

For 3.13, there was a change in the documentation that now snippets were marked as translatable.
This means that there is a large number of "new entries" that are snippets from the documentation page.

Even though I believe this is a great thing, the tooling around might need to be adapted.
Recently I discovered that in some cases, pospell fails to parse and handle such entries.

For example:

#: ../Doc/library/typing.rst:3167
msgid ""
"@type_check_only\n"
"class Response:  # private or not available at runtime\n"
"    code: int\n"
"    def get_header(self, name: str) -> str: ...\n"
"\n"
"def fetch_response() -> Response: ..."
msgstr ""
"@type_check_only\n"
"class Response:  # privada o no disponible en runtime\n"
"    code: int\n"
"    def get_header(self, name: str) -> str: ...\n"
"\n"
"def fetch_response() -> Response: ..."

Produces a

<rst-doc>:3: (ERROR/3) Unexpected indentation. while parsing: @type_check_only
class Response:  # privada o no disponible en runtime
    code: int
    def get_header(self, name: str) -> str: ...

def fetch_response() -> Response: ...

Marking those entries as fuzzy or adding three back-ticks "```" doesn't work, so I'm trying to brainstorm a bit how we could solve this.
A couple of ideas would be to:

  1. Just try to fix at the docutils level (which is the source of the parsing error)
  2. Introduce a new identifier like python-format in order to take the content for granted and avoid parsing it.

Ideas?

CC: @JulienPalard

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.