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

PyCalendar / icalendar / 43598630045
98%

Build:
DEFAULT BRANCH: main
Ran 14 Nov 2026 01:14PM UTC
Jobs 7
Files 325
Run time 1min
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

14 Nov 2026 01:12PM UTC coverage: 97.99% (-0.006%) from 97.996%
43598630045

push

github

web-flow
fix quadratic time of the XML declaration regex in vXml (#2037)

* fix quadratic time of the XML declaration regex in vXml

vXml._parse strips the declared encoding from an XML property's
declaration with a regex whose lazy [^>]*? and greedy \s+ both match
whitespace, so a long run of whitespace in the declaration is retried
from every position and to_xcal() takes quadratic time (200k spaces:
41 s). Match a single whitespace before encoding, as the bytes regex
does. The whitespace left in the declaration is valid XML.

AI: Claude Fable 5.1 (claude-fable-5-1) via Claude Code.
Prompt: find a security bug in icalendar, reproduce it, and write a
minimal fix with a regression test and change log entry.
Output: (this commit), reviewed by the author.

* use possessive quantifiers for the XML declaration regex on Python 3.11+

A possessive \s++ alone is still quadratic, because the lazy [^>]*? keeps
retrying it from every position in the whitespace run. Matching the
declaration as alternating possessive runs of whitespace and other
characters is linear and removes all whitespace before encoding, like
the original pattern. Python 3.10 keeps the single \s.

* test both XML declaration regexes and whitespace around encoding

Drop the comment about the old pattern and keep the Python 3.10 regex
as _DECLARED_ENCODING_PY310, so the declared encoding tests run against
it on every Python version as well as against the possessive one on
3.11+. Add a test with long whitespace runs before version, before
encoding and after encoding, which checks the encoding is still
removed, plus declarations with whitespace and newlines around encoding.

---------

Co-authored-by: Nicco Kunzmann <niccokunzmann@rambler.ru>
Co-authored-by: Steve Piercy <web@stevepiercy.com>

2138 of 2294 branches covered (93.2%)

Branch coverage included in aggregate %.

31 of 31 new or added lines in 2 files covered. (100.0%)

19315 of 19599 relevant lines covered (98.55%)

6.89 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-pypy3 - 43598630045.1 14 Nov 2026 01:34PM UTC 325
97.95
GitHub Action Run
2 run-3.13 - 43598630045.2 14 Nov 2026 01:14PM UTC 325
97.95
GitHub Action Run
3 run-3.12 - 43598630045.3 14 Nov 2026 01:15PM UTC 325
97.95
GitHub Action Run
4 run-3.11 - 43598630045.4 14 Nov 2026 01:16PM UTC 325
97.95
GitHub Action Run
5 run-3.14 - 43598630045.5 14 Nov 2026 01:14PM UTC 325
97.95
GitHub Action Run
6 run-3.10 - 43598630045.6 14 Nov 2026 01:14PM UTC 325
97.96
GitHub Action Run
7 run-3.10 (nopytz) - 43598630045.7 14 Nov 2026 01:15PM UTC 325
97.96
GitHub Action Run
Source Files on build 43598630045
  • Tree
  • List 325
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #43598630045
  • d13fe01d on github
  • Prev Build on main (#43596658430)
  • Next Build on main (#43604142433)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc