Skip to content

Detect map formats after leading blank lines - #85

Open
civilwarinfrance wants to merge 2 commits into
pythonarcade:developmentfrom
civilwarinfrance:fix/leading-blank-map-lines
Open

civilwarinfrance wants to merge 2 commits into
pythonarcade:developmentfrom
civilwarinfrance:fix/leading-blank-map-lines

Conversation

@civilwarinfrance

Copy link
Copy Markdown

Format detection reads only the first line and indexes its first character, so valid JSON or TMX maps with leading blank lines raise IndexError before parsing. Skip blank lines when identifying the format. Empty or whitespace-only files now follow the normal UnknownFormat error path.

Nine regression cases fail upstream and the two no-prefix controls pass. All 137 full-suite tests pass after the fix. Mypy, Ruff, Black, and isort checks pass; no new flake8 findings compared with upstream.

AI-assisted by Codex (GPT-6); prepared and tested by the assistant.

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