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

Warning message for default_utc is incorrect #43

Open
alexkiro opened this issue Apr 11, 2023 · 0 comments
Open

Warning message for default_utc is incorrect #43

alexkiro opened this issue Apr 11, 2023 · 0 comments

Comments

@alexkiro
Copy link

It seems that this warning message may not be accurate anymore and can be a bit misleading?

FutureWarning: Version 0.22.0+ of crontab will use datetime.utcnow() and
datetime.utcfromtimestamp() instead of datetime.now() and
datetime.fromtimestamp() as was previous. This had been a bug, which will be
remedied. If you would like to keep the *old* behavior:
`ct.next(..., default_utc=False)` . If you want to use the new behavior *now*:
`ct.next(..., default_utc=True)`. If you pass a datetime object with a tzinfo
attribute that is not None, timezones will *just work* to the best of their
ability. There are tests...

The warning suggest that for version >= 0.22 the default_utc parameter will default to True if not specified. However that does not appear to be the case in version 1.0.1, and if I understand correctly the default is still the "old" behavior?


I'm unsure what the best solution would be here to resolve this:

  • Update the code to set default_utc to True if not specified and remove the warning.
  • Update the message to change to reflect that it will be changed in a future version (e.g. 1.1?)
  • Something else entirely?
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