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

Move zoneinfo & pytz file I/O to executor #126

Merged
merged 2 commits into from
May 31, 2024
Merged

Move zoneinfo & pytz file I/O to executor #126

merged 2 commits into from
May 31, 2024

Conversation

pnbruckner
Copy link
Owner

Version 2.2 of the astral package, which HA & this integration use, indirectly uses the pytz package when methods are called with "local=True", which this integration does, but HA does not. This can result in file I/O when pytz sees a new time zone name. Starting in HA 2024.6, this will generate a warning.

This PR fixes that by making sure the first call to pytz with a particular time zone name is done in an executor instead of the event loop.

Closes #125

@pnbruckner pnbruckner changed the title Move indirect call to pytz that does file I/O to executor Move zoneinfo & pytz file I/O to executor May 31, 2024
@pnbruckner pnbruckner merged commit 31b40ac into master May 31, 2024
4 checks passed
@pnbruckner pnbruckner deleted the pytz branch May 31, 2024 16:35
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.

[2024.6.0b0]: Detected blocking call to open inside the event loop by custom integration 'sun2'
1 participant