GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
146 stars 27 forks source link

tzlocal 3 causes localize error #94

Closed zmre closed 3 years ago

zmre commented 3 years ago

tzlocal 3.0 dropped today and auto-updated on my system, which caused taskwiki to break, but the root cause is in tasklib. The error is: AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'.

According to the tzlocal changelog:

Switched timezone provider from pytz to zoneinfo (PEP 615)

That change makes line 233 of serializing.py break:

localized = local_zone.localize(value)

Note that there are other lines with calls to localize as well.

I'm not a python dev and don't know how breaking libraries should be handled. For now, I've downgraded tzlocal on my machine back to 2.1, but this is a brittle solution. Hopefully this gives you enough info to put together a fix before more people start breaking.

Jasha10 commented 3 years ago

Another workaround (editing the serializing.py file) is detailed in #95.