Skip to content

fix: allow subsecond precision beyond 9 digits in ISO 8601 parser#959

Closed
JKDasondee wants to merge 2 commits intopython-pendulum:masterfrom
JKDasondee:fix/935-subsecond-digits-regex
Closed

fix: allow subsecond precision beyond 9 digits in ISO 8601 parser#959
JKDasondee wants to merge 2 commits intopython-pendulum:masterfrom
JKDasondee:fix/935-subsecond-digits-regex

Conversation

@JKDasondee
Copy link
Copy Markdown

Fixes #935

The ISO 8601 regex restricts subsecond digits to \d{1,9}, causing ParserError for timestamps with 10+ fractional digits. Since the subsecond value is already truncated to 6 characters (subsecond[:6]) before conversion, the regex limit is the only blocker. Changed \d{1,9} to \d+ to match what Python's own fromisoformat accepts.

@Secrus
Copy link
Copy Markdown
Collaborator

Secrus commented Apr 10, 2026

Same as #960, weird mixture of commits. Please, clean up your patch and provide tests for the changed code.

@Secrus Secrus closed this Apr 10, 2026
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 fails with subsecond decimals with more than 9 digits

2 participants