Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 464 #471

Merged
merged 3 commits into from Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -18,7 +18,10 @@ New features:

Bug fixes:

- ...
- broken properties are not added to the parent component
Ref: #471
Fixes: #464
[jacadzaca]

5.0.1 (2022-10-22)
------------------
Expand Down
1 change: 0 additions & 1 deletion src/icalendar/cal.py
Expand Up @@ -383,7 +383,6 @@ def from_ical(cls, st, multiple=False):
if not component.ignore_exceptions:
raise
component.errors.append((uname, str(e)))
component.add(name, None, encode=0)
else:
vals.params = params
component.add(name, vals, encode=0)
Expand Down
7 changes: 7 additions & 0 deletions src/icalendar/tests/events/issue_464_invalid_rdate.ics
@@ -0,0 +1,7 @@
BEGIN:VEVENT
SUMMARY:RDATE period
DTSTART:19961230T020000Z
DTEND:19961230T060000Z
UID:rdate_period
RDATE;VALUE=PERIOD:19970101T180000Z/19970102T070000Z,199709T180000Z/PT5H30M
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the problem we have here is that one element in this list is actually ok and the other one is not. How can that be reflected?

Is it ok to skip the whole RDATE ... probably is for now. It should be rare to have an invalid rdate.

END:VEVENT
Expand Up @@ -18,3 +18,11 @@ def test_dont_ignore_exceptions_on_broken_calendars_issue_104(calendars):
'''
with pytest.raises(ValueError):
calendars.issue_104_broken_calendar

def test_rdate_dosent_become_none_on_invalid_input_issue_464(events):
'''Issue #464 - [BUG] RDATE can become None if value is invalid
https://github.com/collective/icalendar/issues/464
'''
assert events.issue_464_invalid_rdate.is_broken
assert ('RDATE', 'Expected period format, got: 199709T180000Z/PT5H30M') in events.issue_464_invalid_rdate.errors
assert not b'RDATE:None' in events.issue_464_invalid_rdate.to_ical()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! The test is alright.