python-o365
python-o365 copied to clipboard
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
I am getting an error:
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
The self.protocol.timezone object is the one being referenced by the error.
It looks like an upgrade to tzlocal is causing the issue:
When I downgrade to 4.3 I don't see the error.
This is essentially the code used:
account = Account(*args)
query = account.mailbox.q().on_attribute("created_date_time").greater(some_datetime) # this line produces error above
I am going to pin tzlocal<5 in my requirements file for now.
Fixed now thanks
Is there a lot involved in migrating O365 from pytz to zoneinfo? At face value it'd be nice to drop pytz as a dependency but I don't know how tied to it this repo is.
There's some work to do and I don't have any free time to do it