GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `pospell` fails with code entries · Issue #3324 · python/python-docs-es

pospell fails with code entries #3324

New issue
Copy link
New issue
Copy link
Open
Open
pospell fails with code entries#3324
Copy link

Description

@cmaureir
cmaureir
opened on Nov 24, 2024
Issue body actions

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

Activity

  1. cmaureir commented on Nov 24, 2024

    @cmaureir
    cmaureir
    on Nov 24, 2024
    CollaboratorAuthor
    More actions

    OK, so I found out that if I don't translate the code entries, we could bypass the error.

  2. cacrespo
    added a commit that references this issue on Dec 1, 2024

    Workaround for issue python#3324: Fix indentation issues caused by co…

    ac34348
  3. cacrespo commented on Dec 1, 2024

    @cacrespo
    cacrespo
    on Dec 1, 2024
    Collaborator
    More actions

    As far I understand, the problem here is because the most of code snippets entries (maybe all) have '\n' breaklines.
    I'm not sure, but the fails could be originted when pospell try to transform reStructuredText to plain text.

    @rtobar, I've implemented a temporary solution (bastante fiera!) in our script that skips the checks for these entries.

  4. cmaureir
    added a commit that references this issue on Oct 14, 2025

    Workaround to fix code snippets issues on pospell (#3346)

    9448c5d
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.