+
    ¾¾j   ã                   ó–   € R t ^ RIt^ RIHt ^ RIHt ^ RIHt ]P                  P                  R. RO4      R 4       t
R tR tR	 tR
 tR# )a×  A duration too large for ``datetime.timedelta`` must raise ``InvalidCalendar``.

``DURATION_REGEX`` accepts an unbounded run of digits, but ``timedelta`` rejects
values that overflow its C implementation with ``OverflowError``. That error used
to leak out of :meth:`vDuration.from_ical`, so callers catching the documented
:exc:`ValueError` / :class:`~icalendar.error.InvalidCalendar` crashed instead.
It is now reported as an invalid duration, like any other bad value.
N)ÚCalendar)ÚInvalidCalendar)Ú	vDurationÚvaluec                ó°   € \         P                  ! \        4      ;_uu_ 4        \        P                  ! V 4       RRR4       R#   + '       g   i     R# ; i)zBAn overflowing duration raises InvalidCalendar, not OverflowError.N)ÚpytestÚraisesr   r   Ú	from_ical)r   s   &Új/home/ralf/ical-fahrzeuge/venv/lib/python3.14/site-packages/icalendar/tests/prop/test_duration_overflow.pyÚ5test_vDuration_from_ical_rejects_overflowing_durationr      s0   € ô 
�Š”×	'Õ	'Ü×Ò˜EÔ"÷ 
(×	'×	'Ò	'úó   £AÁA	c                 ó°   € \         P                  ! \        4      ;_uu_ 4        \        P                  ! R4       RRR4       R#   + '       g   i     R# ; i)zHInvalidCalendar is a ValueError, so the common except clause catches it.ÚP999999999999999999WN)r   r   Ú
ValueErrorr   r	   © ó    r
   Ú*test_overflowing_duration_is_a_value_errorr      s/   € ä	�Š”z×	"Õ	"Ü×ÒÐ2Ô3÷ 
#×	"×	"Ò	"úr   c                 óü   € Rp \         P                  ! V 4      pVP                  ^ ,          p\        ;QJ d&    R VP                   4       F  '       g   K   RM	  RM! R VP                   4       4      '       g   Q hR# )a  A full calendar parse records the bad duration instead of crashing.

Before the fix the ``OverflowError`` escaped the component parser (which
only catches ``ValueError``) and aborted the whole parse. Now the value is
handled like any other invalid property and recorded in ``errors``.
zzBEGIN:VCALENDAR
BEGIN:VEVENT
UID:1
DTSTART:20240101T000000Z
DURATION:P999999999999999999W
END:VEVENT
END:VCALENDAR
c              3   ó0   "  € T F  w  rVR 8H  x € K  	  R# 5i©ÚDURATIONNr   ©Ú.0ÚnameÚ_s   &  r
   Ú	<genexpr>ÚOtest_overflowing_duration_in_calendar_is_recorded_not_raised.<locals>.<genexpr>7   ó   é € Ð>±¡g dˆt�zÖ!³ùó   ‚TFN)r   r	   ÚsubcomponentsÚanyÚerrors)ÚicsÚcalendarÚevents      r
   Ú<test_overflowing_duration_in_calendar_is_recorded_not_raisedr%   %   s]   € ð	ð ô ×!Ò! #Ó&€HØ×"Ñ" 1Õ%€Eß‹3Ñ>°·²Ó>�3�3Š3Ñ>°·²Ó>×>Ò>Ð>Ò>r   c                ó  € V P                   pVP                  R4      ^ ,          p\        ;QJ d&    R VP                   4       F  '       g   K   RM	  RM! R VP                   4       4      '       g   Q hRVP	                  4       9   g   Q hR# )ak  A calendar with an impractical duration keeps the raw value on to_ical.

The value cannot be decoded to a :class:`datetime.timedelta`, so it is kept
as a broken value. Serializing the calendar again must reproduce the
original ``DURATION`` text unchanged rather than dropping it. Runs against
both ``Calendar`` and ``LazyCalendar`` via the ``calendars`` fixture.
ÚVEVENTc              3   ó0   "  € T F  w  rVR 8H  x € K  	  R# 5ir   r   r   s   &  r
   r   ÚFtest_invalid_duration_calendar_keeps_original_value.<locals>.<genexpr>D   r   r   TFs   DURATION:P999999999999999999WN)Úinvalid_durationÚwalkr    r!   Úto_ical)Ú	calendarsr#   r$   s   &  r
   Ú3test_invalid_duration_calendar_keeps_original_valuer.   :   sh   € ð ×)Ñ)€HØ�M‰M˜(Ó# AÕ&€Eß‹3Ñ>°·²Ó>�3�3Š3Ñ>°·²Ó>×>Ò>Ð>Ð>Ø+¨x×/?Ñ/?Ó/AÔAÐAÒAr   c                 óê   € ^ RI Hp  \        P                  ! R4      V ! ^RR7      8X  g   Q h\        P                  ! R4      V ! ^1R7      8X  g   Q h\        P                  ! R4      V ! R	4      8X  g   Q hR# )
z1The guard must not affect durations within range.©Ú	timedeltaÚP15DT5H0M20SidF  )ÚdaysÚsecondsÚP7W)r3   z-P14DNiòÿÿÿ)Údatetimer1   r   r	   r0   s    r
   Ú test_valid_durations_still_parser7   H   s`   € å"ä×Ò˜~Ó.±)ÀÈUÔ2SÔSÐSÐSÜ×Ò˜uÓ%©¸Ô);Ô;Ð;Ð;Ü×Ò˜wÓ'©9°S«>Ô9Ð9Ò9r   )r   ÚP1000000000000000000000DÚPT999999999999999999999H)Ú__doc__r   Ú	icalendarr   Úicalendar.errorr   Úicalendar.propr   ÚmarkÚparametrizer   r   r%   r.   r7   r   r   r
   Ú<module>r@      sX   ðñó å Ý +Ý $ð ‡�×ÑØòóñ#óð#ò4ò?ò*Bô:r   