O365 / python-o365

A simple python library to interact with Microsoft Graph and Office 365 API
Apache License 2.0
1.67k stars 422 forks source link

Bug introduced in latest release of tzlocal dependency package #677

Closed codectl closed 3 years ago

codectl commented 3 years ago

I believe the latest release for tzlocal (3.0) has introduced the error below:

  File "/usr/local/lib/python3.8/site-packages/O365/message.py", line 690, in send
    self.save_draft()
  File "/usr/local/lib/python3.8/site-packages/O365/message.py", line 1000, in save_draft
    self.__modified = self.protocol.timezone.localize(dt.datetime.now())
AttributeError: 'backports.zoneinfo.ZoneInfo' object has no attribute 'localize'

It's a breaking change so it requires a fix as soon as possible.

codectl commented 3 years ago

Yep there you go, Replaced pytz with zoneinfo.

So localize is no longer a valid attribute for self.protocol.timezone.

alejcas commented 3 years ago

PR #671 already merged solved this

codectl commented 3 years ago

PR #671 already merged solved this

I see . However, the presented solution does not seem to be working for me since I ended up with version 3.0 installed.

codectl commented 3 years ago

Ok nevermind, the solution works, now it makes sense. However the pipy needs a new release. Therefore the current release still introduces the issue.