Repository navigation
fix(prop): parse leap seconds like the xCal path does - #2044
rahul05ranjan wants to merge 3 commits into
Conversation
|
Thanks for the pull request, @rahul05ranjan! A maintainer will review it shortly. |
Automation signalsActivity patterns show signs of automation. Evidence
Last 5 PRs: This is an automated analysis by AgentScan |
|
One or more PR-quality checks did not pass. Review the PR Quality Checks summary in the workflow run for the failed checks and their details, then make any necessary updates. Checklist items may remain unchecked while work is in progress. Please tick each item as you complete it. If you used AI assistance, follow the project's Responsible AI use policy and provide the required disclosures. |
|
Updated the description to follow the PR template (issue linked, sections reorganized, change log and tests ticked in the checklist), and pushed 131ae01, which asserts the specific On the remaining CI: the only failing test on 3.14 and in the source-distribution job is |
|
There are unchecked items in the PR descriptio. Please finish thouse first, before we continue with a review. |
|
Additionally, there is a conflict in |
|
Thanks @angatha — the items here too:
I will address the AI-policy item separately. |
| @@ -0,0 +1 @@ | |||
| Fix the parsing of leap seconds (``time-second = 60`` per RFC 5545): ``vTime.from_ical``, ``vDatetime.from_ical``, ``vTime.parse_jcal_value`` and ``vDatetime.parse_jcal_value`` now clamp the value to 59 like the xCal paths instead of raising a parsing error. @rahul05ranjan | |||
There was a problem hiding this comment.
Technically fine. Could you adjust this so the methods link like in the other entries?
There was a problem hiding this comment.
Done in the latest push: the entry now links the four methods with :meth: roles like the other entries, and carries the brief AI-use disclosure this project asks for.
|
Thanks for the PR! It is nice to have this more consietent. |
AI-assisted change: drafted with DeepSeek-v4-pro (OpenRouter); prompts summarized, output reviewed and validated against the issue.
AI-assisted change: drafted with DeepSeek-v4-pro (OpenRouter); prompts summarized, output reviewed and validated against the issue.
AI-assisted change: drafted with DeepSeek-v4-pro (OpenRouter); prompts summarized, output reviewed and validated against the issue.
361effb to
8041290
Compare
|
Rebased onto latest main, which clears the The review points are addressed:
|
Linked issue
Description
RFC 5545 sections 3.3.5 and 3.3.12 define
time-second = 2DIGIT ;00-60— the value 60 is the leap second. The xCal parsing paths ofvTimeandvDatetimeaccept it and clamp it to 59; the iCalendar-format and jCal paths of the same classes reject it, so an event whose property value falls on a leap second — e.g. a reminder scheduled at20161231T235960Z, which existed in UTC — fails to parse.Repro (stdlib only)
Fix
Clamp a time-second of 60 to 59 before constructing the
datetime.time/datetime.datetime, with the same comment the xCal paths already use ("This is wrong but we have no way to represent this"), in:vTime.from_ical(iCalendar format)vDatetime.from_ical(iCalendar format)vTime.parse_jcal_value(jCal)vDatetime.parse_jcal_value(jCal)Seconds beyond the RFC's range (e.g.
:61) still raise the same errors as before.Checklist
Additional information
...:59:59after.test_from_ical_accepts_leap_second(3 parametrized cases),test_vdatetime_from_ical_accepts_leap_second(2 cases),test_parse_jcal_value_accepts_leap_second,test_parse_jcal_value_still_rejects_out_of_range,test_vdatetime_parse_jcal_value_accepts_leap_second.