Skip to content

Support compact fixed-width formats in parse_time - #1518

Open
dongyikuan919 wants to merge 1 commit into
python-babel:masterfrom
dongyikuan919:fix/parse-compact-time
Open

dongyikuan919 wants to merge 1 commit into
python-babel:masterfrom
dongyikuan919:fix/parse-compact-time

Conversation

@dongyikuan919

Copy link
Copy Markdown

Fixes #1517.

parse_time now round-trips explicit, separator-free formats made of two-digit 24-hour and minute fields with optional two-digit seconds. It splits a complete digit string into pairs and passes them to the existing field-order and range checks.

Regression cases cover HHmm, mmHH, HHmmss, ssmmHH, and out-of-range seconds. The full test suite passed locally on Python 3.11 (8,295 passed, 3 skipped, 2 expected failures). Ruff also passed for the changed files.

Developed with Codex assistance.

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.

parse_time cannot read explicit compact formats produced by format_time

1 participant