Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'zoneinfo.ZoneInfo' object has no attribute 'zone' #1047

Closed
MarcoMiano opened this issue Jan 24, 2024 · 1 comment
Closed

'zoneinfo.ZoneInfo' object has no attribute 'zone' #1047

MarcoMiano opened this issue Jan 24, 2024 · 1 comment

Comments

@MarcoMiano
Copy link

MarcoMiano commented Jan 24, 2024

Hi,
i'm trying to write a simple script for reading calendars events. but I get the error in the title if I just install O365 with pip.
The error occurs with the following packages installed:

beautifulsoup4 = 4.12.3
certifi = 2023.11.17
charset-normalizer 3.3.2
idna = 3.6
O365 = 2.0.32
oauthlib = 3.2.2
pip = 23.3.1
python = 3.12.1
python-dateutil = 2.8.2
pytz = 2023.3.post1
requests = 2.31.0
requests-oauthlib = 1.3.1
setuptools = 68.2.2
six = 1.16.0
soupsieve = 2.5
stringcase = 1.2.0
tzdata = 2023.4
tzlocal = 5.2
urllib3 = 2.1.0
wheel = 0.41.2

Full Error:

Traceback (most recent call last):
  File "c:\[redacted]\main.py", line 39, in <module>
    main()
  File "c:\[redacted]\main.py", line 34, in main
    for event in events:
  File "C:\[redacted]\AppData\Local\anaconda3\envs\work\Lib\site-packages\O365\calendar.py", line 1805, in <genexpr>
    events = (self.event_constructor(parent=self,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\[redacted]\AppData\Local\anaconda3\envs\work\Lib\site-packages\O365\calendar.py", line 911, in __init__
    self.__recurrence = EventRecurrence(event=self,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\[redacted]\AppData\Local\anaconda3\envs\work\Lib\site-packages\O365\calendar.py", line 137, in __init__
    get_windows_tz(self.protocol.timezone))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\[redacted]\AppData\Local\anaconda3\envs\work\Lib\site-packages\O365\utils\windows_tz.py", line 638, in get_windows_tz
    iana_tz.zone if isinstance(iana_tz, tzinfo) else iana_tz)

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

If I roll back to tzlocal 2.1 pip complains that tzlocal should be >= 5.0 but i don't get the error anymore.

ps: typechecking will broke with all the class constructors type with * | None... not really a problem BTW.
pps: probably a problem of conda, but installing O365 with conda install is nearly impossible

@MarcoMiano
Copy link
Author

didn't saw #1044... sry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant