• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

collective / icalendar / 26219394471 / 3
98%
main: 98%

Build:
DEFAULT BRANCH: main
Ran 21 May 2026 10:16AM UTC
Files 229
Run time 13s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 May 2026 10:05AM UTC coverage: 97.733% (+0.003%) from 97.73%
26219394471.3

push

github

web-flow
Fix RecursionError in Component.__repr__ on deeply nested calendars (Closes #1370) (#1371)

* Fix RecursionError in Component.__repr__ on deeply nested calendars

Component.__repr__ recursively calls str() on every subcomponent.
Parsing accepts BEGIN/END nesting of arbitrary depth (the parser
itself is iterative), so a ~13 KB .ics with ~500 nested VEVENTs
caused any caller doing repr(cal) / str(cal) / f"{cal}" to raise
an uncaught RecursionError at the default recursion limit.

This affects logging, error reporting, and debug-page rendering of
attacker-controlled calendars (e.g. CalDAV, .ics import endpoints,
calendar invitation processing).

Replaced the recursive implementation with an iterative stack-based
walk. Output format is unchanged for normally-shaped calendars.
Added regression tests covering depths up to 1000 and the unchanged
shallow-calendar format.

Existing OSS-Fuzz harness in src/icalendar/fuzzing/ical_fuzzer.py
exercises from_ical() / walk() / to_ical() but not __repr__, which
is why this code path slipped through fuzzing.

* Address review feedback: parametrize str test, add exact-equality tests

Per @angatha review on PR #1371:

- Parametrize ``test_str_does_not_raise_recursion_error`` with the same
  depths as the ``repr()`` test ([10, 100, 500, 1000]) and combine the
  two into a single test whose only varying axis (besides depth) is the
  string-conversion function.

- Add exact-equality tests for ``repr()`` output:

  * ``test_repr_exact_output_for_nested_components`` builds nested empty
    ``Event``s under a ``Calendar`` and asserts the entire ``repr()``
    string equals the format produced by the previous recursive
    implementation: ``VCALENDAR({}, VEVENT({}, ...))``.

  * ``test_repr_exact_output_for_sibling_components`` does the same for
    two sibling VEVENTs: ``VCALENDAR({}, VEVENT({}), VEVENT({}))``.

  Using empty constructed components keeps the expected string
  independent of the ``repr`` of any parsed property value.

755 of 777 branches covered (97.17%)

Branch coverage included in aggregate %.

12393 of 12676 relevant lines covered (97.77%)

0.98 hits per line

Source Files on job run-3.11 - 26219394471.3
  • Tree
  • List 229
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 26219394471
  • 67d6ab97 on github
  • Prev Job for on main (#26029940281.6)
  • Next Job for on main (#26246962515.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc