Skip to content

Fix rrulestr dropping TZID when followed by other parameters (#1611) - #1612

Open
Fire162 wants to merge 3 commits into
dateutil:masterfrom
Fire162:fix/rrulestr-tzid-parameter-order
Open

Fire162 wants to merge 3 commits into
dateutil:masterfrom
Fire162:fix/rrulestr-tzid-parameter-order

Conversation

@Fire162

@Fire162 Fire162 commented Oct 14, 2026

Copy link
Copy Markdown

Summary

Fixes #1611.

In RFC 5545 section 3.8.2.4, property parameters may appear in any order. In _rrulestr._parse_rfc, the regex extracting timezone names (TZID_NAMES) was matching TZID=(?P<name>[^:]+):. If another parameter (such as VALUE=DATE-TIME) followed TZID before the colon separator, [^:]+ captured ;VALUE=DATE-TIME as part of the timezone name, leading to a KeyError during lookup in rule_tzids and silently dropping the timezone.

Changes

  • Updated the TZID extraction regex to stop at semicolons or colons ([^:;]+) and recognize TZID case-insensitively.
  • Added regression tests in tests/test_rrule.py covering DTSTART with TZID preceding VALUE=DATE-TIME, case-insensitive parameter names, and EXDATE with TZID preceding VALUE=DATE-TIME.

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