Skip to content

Fix tab-separated PO locations with enclosed filenames - #1384

Open
Aurantium-47 wants to merge 1 commit into
python-babel:masterfrom
Aurantium-47:fix/po-tab-separated-locations
Open

Aurantium-47 wants to merge 1 commit into
python-babel:masterfrom
Aurantium-47:fix/po-tab-separated-locations

Conversation

@Aurantium-47

Copy link
Copy Markdown

When a PO location comment contains an FSI/PDI-enclosed filename, the parser only treats spaces as separators. A tab between references is then retained as part of a filename (or becomes a spurious reference when surrounded by spaces). Comments without enclosed filenames already accept tab separators.

Treat tabs outside the filename enclosure as separators too, while preserving tabs inside enclosed filenames. The regression tests exercise read_po with plain and enclosed filenames, tab-only separators, and mixed space/tab separators.

Validation on Windows with Python 3.12:

  • Both new regression cases fail on the unmodified base.
  • python -m pytest tests/messages -q: 389 passed, one existing pytest deprecation warning, with CLDR 48.2 imported using the repository script.
  • Ruff 0.14.10 (the pinned hook version) passes for both changed files; git diff --check passes.

AI assistance: implementation, tests, and this description were prepared with OpenAI Codex; the patch received a separate AI code review.

Assisted-by: OpenAI GPT-6 <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant