You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate TZID in VTIMEZONE crashes from_ical with AttributeError ('list' object has no attribute 'strip') #2111
Duplicate TZID line in a VTIMEZONE crashes parsing with AttributeError ('list' object has no attribute 'strip')
A calendar with a repeated TZID property inside the same VTIMEZONE (easy to produce with a broken or hand-edited generator) makes Calendar.from_ical() die with an AttributeError deep inside the timezone cache instead of a parse error:
from_ical() should either accept the (duplicate) definition or raise a normal parsing error (ICalParsingError/ValueError) — not an AttributeError from the timezone machinery.
What happens
With two TZID lines the component's TZID value becomes a list (two entries), and cache_timezone_component() passes that list into clean_timezone_id(), which calls tzid.strip("/") (src/icalendar/timezone/tzp.py:170) assuming a string. Anything that reads .ics text from untrusted/legacy sources hits this as a hard crash. Verified on main at ed63cc0, found by mutation fuzzing of a valid calendar. A type guard in clean_timezone_id (take tzid[0] / reject non-strings) or using the component's documented single-value access would fix it.
Activity
github-actions commentedon Nov 14, 2026
Thanks for the issue, @rahul05ranjan! A maintainer will review it shortly.
github-actions commentedon Nov 14, 2026
Mixed activity
Activity patterns show a mix of organic and automated signals.
View full analysis →
Evidence
Last 5 PRs:
This is an automated analysis by AgentScan
fix(timezone): handle duplicate TZID in VTIMEZONE without crashing (P…
fix(timezone): handle duplicate TZID in VTIMEZONE without crashing (P…