Skip to content

AttributeError when processing iCloud calendar with DATE-only RECURRENCE-ID #123

@abe-101

Description

@abe-101

Describe the bug

AttributeError when processing iCloud calendar with DATE-only RECURRENCE-ID

When processing an iCloud calendar event with a RECURRENCE-ID that has VALUE=DATE parameter, the merge operation fails with:

AttributeError: 'datetime.date' object has no attribute 'astimezone'

To Reproduce

Steps to reproduce

  1. Import an iCloud calendar containing recurring events
  2. Event has RECURRENCE-ID with VALUE=DATE parameter
  3. Attempt to merge calendars

Stack trace

Error occurs in merge() when attempting to call astimezone() on a date-only RECURRENCE-ID value.

Fix suggestion

Check if recurrence_id.dt is a date object before calling astimezone. If it is, convert it to a datetime first.

Additional context

No response

Version

0.4.1

Platform

Ubuntu

Code of Conduct

  • I agree to follow this project's Code of Conduct.

No Duplicate

  • I have checked existing issues to avoid duplicates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions