Skip to content

Fix sub-minute ISO-8601 UTC offset parsing in DateTimeParser and TzinfoParser - #1405

Open
jeff-grimes-pplx wants to merge 1 commit into
arrow-py:masterfrom
jeff-grimes-pplx:fix/subminute-tz-offset-parsing
Open

jeff-grimes-pplx wants to merge 1 commit into
arrow-py:masterfrom
jeff-grimes-pplx:fix/subminute-tz-offset-parsing

Conversation

@jeff-grimes-pplx

Copy link
Copy Markdown

Summary

  • Fixes silent truncation of the seconds component in TzinfoParser.parse() when given an ISO 8601 UTC offset with seconds (±HH:MM:SS or ±HHMMSS), which previously matched only ±HH:MM and discarded :SS.
  • Extends DateTimeParser._TZ_Z_RE and DateTimeParser._TZ_ZZ_RE to accept optional seconds in Z / ZZ tokens so arrow.get(a.isoformat()) round-trips cleanly for timestamps with sub-minute UTC offsets (such as historical IANA timezones like America/St_Johns or Europe/Amsterdam).
  • Adds unit tests in tests/test_parser.py covering TzinfoParser.parse and DateTimeParser.parse_iso.

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (2d0c43f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1405   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2315           
  Branches       358       358           
=========================================
  Hits          2315      2315           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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