Skip to content

Commit

Permalink
Merge pull request #471 from jacadzaca/fix-464
Browse files Browse the repository at this point in the history
Fix 464
  • Loading branch information
niccokunzmann committed Oct 23, 2022
2 parents f733db1 + 1deffcc commit ca7af0d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
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
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()

0 comments on commit ca7af0d

Please sign in to comment.