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

[BUG] RDATE can become None if value is invalid #464

Closed
5 tasks done
niccokunzmann opened this issue Oct 19, 2022 · 0 comments · Fixed by #471
Closed
5 tasks done

[BUG] RDATE can become None if value is invalid #464

niccokunzmann opened this issue Oct 19, 2022 · 0 comments · Fixed by #471

Comments

@niccokunzmann
Copy link
Member

niccokunzmann commented Oct 19, 2022

Describe the bug

The RDATE is None if it has an invalid PERIOD value in a list and that has an effect on the to_ical fundtion: None is in the ical, making it invalid RFC.

To Reproduce

>>>> import icalendar
>>>> s = b"""BEGIN:VEVENT
.... SUMMARY:RDATE period
.... DTSTART:19961230T020000Z
.... DTEND:19961230T060000Z
.... UID:rdate_period
.... RDATE;VALUE=PERIOD:19970101T180000Z/19970102T070000Z,199709T180000Z/PT5H30M
.... END:VEVENT"""
>>>> event = icalendar.Event.from_ical(s)
>>>> print(event.to_ical().decode())
BEGIN:VEVENT
SUMMARY:RDATE period
DTSTART:19961230T020000Z
DTEND:19961230T060000Z
UID:rdate_period
RDATE:None                <------- error!
END:VEVENT

Expected behavior**

I would expect

  1. That the error is recorded in the event
  2. that this is not None as a value

Environment

  • OS: Ubuntu
  • Python version: 3.9
  • icalendar version: 5.0.0

Additional context

  • I tested it with the latest version pip3 install https://github.com/collective/icalendar.git
  • I attached the ICS source file or there is no ICS source file
@niccokunzmann niccokunzmann changed the title [BUG] [BUG] RDATE can become None if value is invalid Oct 19, 2022
jacadzaca added a commit to jacadzaca/icalendar that referenced this issue Oct 23, 2022
@jacadzaca jacadzaca mentioned this issue Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant