python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'

Open liamcryan opened this issue 2 years ago • 3 comments

I am getting an error:

AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'

link to line: image

The self.protocol.timezone object is the one being referenced by the error.

It looks like an upgrade to tzlocal is causing the issue: image

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.

liamcryan avatar May 15 '23 16:05 liamcryan

Fixed now thanks

alejcas avatar May 30 '23 08:05 alejcas

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.

owenlamont avatar Jun 01 '23 12:06 owenlamont

There's some work to do and I don't have any free time to do it

alejcas avatar Jun 01 '23 16:06 alejcas