Skip to content

Reject non-boolean TOML defaults for pybabel flags - #1526

Open
bug-origin wants to merge 1 commit into
python-babel:masterfrom
bug-origin:fix/toml-boolean-options
Open

bug-origin wants to merge 1 commit into
python-babel:masterfrom
bug-origin:fix/toml-boolean-options

Conversation

@bug-origin

Copy link
Copy Markdown

Fixes #1525.

With ignore_obsolete = "false" in TOML, pybabel update uses the nonempty string as a true value and discards obsolete translations. The CLI now checks boolean options while it reads their defaults, reports the table and option to correct, and exits before opening the catalog for writing.

The regression test runs the update command and checks that an invalid setting leaves the PO file byte-for-byte intact. It also covers native TOML booleans and a command-line override.

Ran pytest -q on Python 3.13 with locale data from the Babel 2.19.0 wheel. 8,298 passed, 3 skipped, 2 expected failures.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quoted false in TOML ignore_obsolete silently enables translation removal

2 participants