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

Date deprectation warnings #1111

Open
MusicalNinjaDad opened this issue Jan 13, 2024 · 1 comment · May be fixed by #1116
Open

Date deprectation warnings #1111

MusicalNinjaDad opened this issue Jan 13, 2024 · 1 comment · May be fixed by #1116

Comments

@MusicalNinjaDad
Copy link

MusicalNinjaDad commented Jan 13, 2024

internal_devices.TimeOfDay offers a non-timezone-aware interface. datetime.utcnow() which is used in value is deprecated from Python3.12 onwards with a rationale to improving timezone awareness and handling in the wider codebase.

Doing anything other than filtering this is potentially dangerous. In my opinion, we should look to update TimeOfDay:

  1. to offer a TimeZone aware interface, including a UTC option (e.g. adding a timezone keyword which defaults to local timezone)
  2. raise DeprecationWarnings ourselves for those using the current naive option (utc=True)
  3. then later remove the naive option as it provides hobby programmers with a high-potential source of error.
  4. Adding a timezone-aware recipe or two would definitely be a good idea when doing this.

For now I have filtered out the Deprecation Warning with PR #1112

@MusicalNinjaDad
Copy link
Author

OK - this challenge wouldn't leave me in peace so I've made an attempt to suggest how it could be managed - see #1116

@MusicalNinjaDad MusicalNinjaDad linked a pull request Feb 3, 2024 that will close this issue
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 a pull request may close this issue.

1 participant