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

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

Open
bwurst opened this issue Sep 28, 2021 · 3 comments
Open

Comments

@bwurst
Copy link

bwurst commented Sep 28, 2021

When I issue the command
calendar-cli calendar agenda
against my nextcloud 20.0 server, I get the error

  File "/usr/local/lib/python3.9/dist-packages/calendar_cli-0.12.1-py3.9.egg/EGG-INFO/scripts/calendar-cli", line 992, in <module>
  File "/usr/local/lib/python3.9/dist-packages/calendar_cli-0.12.1-py3.9.egg/EGG-INFO/scripts/calendar-cli", line 983, in main
  File "/usr/local/lib/python3.9/dist-packages/calendar_cli-0.12.1-py3.9.egg/EGG-INFO/scripts/calendar-cli", line 534, in calendar_agenda
AttributeError: 'datetime.date' object has no attribute 'astimezone'

when an all day event is to be displayed. When no such event is visible in the specified date range, the error goes away.

calendar-cli is installed in debian stable.

@tobixen
Copy link
Owner

tobixen commented Sep 28, 2021

Seems familiar. I discovered some similar problems on Ubuntu the other day while running tests for the caldav library, and I made a fix for it in the caldav library. I'll have a look.

tobixen added a commit that referenced this issue Sep 28, 2021
@tobixen
Copy link
Owner

tobixen commented Sep 28, 2021

No, it was a different problem I had in the caldav library. In your traceback, the calendar-cli is trying to fix timezone info for a date - and that breaks, a date cannot have time zone data applied to it. I've made a quick fix now in master (without testing - I'm a bit in a rush now). I should probably investigate deeper a bit later (code looks quite complex, could it be refactored?).

@bwurst
Copy link
Author

bwurst commented Sep 28, 2021

Thanks a lot! I tried it, the current git version fixes this problem for me!

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

No branches or pull requests

2 participants