Skip to content

Conversation

@regebro
Copy link

@regebro regebro commented May 18, 2023

tzlocal 5 now uses logging, which means that rfc5424 gets a recursive import error with tzlocal 5.0.1 and later. This PR solves that, and also does not call tzlocal every time a message is formatted. tzlocals get_localzone() does cache the result, so it's not a big burden, but it's still not necessary.

An alternative solution is to store the get_localzone method on the logger, if you want to be able refreshing the local zone at runtime, but the feature was implemented to support testing, I really don't think anyone uses it.

tzlocal 5 now uses logging, which means that rfc5424 gets a recursive import error with tzlocal 5.0.1 and later.
This PR solves that, and also does not call tzlocal every time a message is formatted. tzlocals get_localzone()
does cache the result, so it's not a big burden, but it's still not necessary.
@regebro
Copy link
Author

regebro commented May 31, 2023

Or maybe even better, don't use tzlocal at all? It seems to be used to convert local time to UTC, you don't need to know the timezone name to do that.

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.

1 participant