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

default to utc if no timezone is set #1078

Closed
wants to merge 1 commit into from
Closed

default to utc if no timezone is set #1078

wants to merge 1 commit into from

Conversation

dekiesel
Copy link

Fixes #1077

@dekiesel
Copy link
Author

dekiesel commented May 29, 2024

(.venv) d@lap:~/pull_requests/python-o365$ pytest tests/test_connection.py 
=================================================== test session starts ===================================================
platform linux -- Python 3.12.3, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/d/pull_requests/python-o365
collected 1 item                                                                                                          

tests/test_connection.py .                                                                                          [100%]

==================================================== 1 passed in 0.18s ====================================================

@alejcas
Copy link
Member

alejcas commented May 30, 2024

I don't understand what's the problem here, but I think the fix here is not appropiate (or maybe the tittle of the PR is incorrect).

The current implementation already defaults to UTC:

# get_localzone() from tzlocal will try to get the system local timezone and if not will return UTC

https://github.com/O365/python-o365/blob/master/O365/connection.py#L104

I'll continue on the issue...

@dekiesel dekiesel closed this by deleting the head repository May 31, 2024
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

Successfully merging this pull request may close these issues.

AttributeError: 'datetime.timezone' object has no attribute 'key
2 participants