tobixen / calendar-cli

Simple command-line CalDav client, for adding and browsing calendar items, todo list items
GNU General Public License v3.0
247 stars 23 forks source link

Warning in zone usage of pytz with Python 3.10 #89

Closed bug closed 2 years ago

bug commented 2 years ago

Since Python 3.10, I have this warning when I create an event:

calendar-cli.py:366: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html dtstart = _tz(args.timezone).localize(dtstart) /usr/lib/python3.10/site-packages/icalendar/parser.py:54: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html if hasattr(dt.tzinfo, 'zone'): /usr/lib/python3.10/site-packages/icalendar/parser.py:55: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html tzid = dt.tzinfo.zone # pytz implementation

tobixen commented 2 years ago

We still need to use pytz, until https://github.com/collective/icalendar/issues/333 has been resolved - but I think I've managed to tweak calendar-cli not to yield warnings in the head of the master branch.