Skip to content

Warning message for default_utc is incorrect #43

Description

@alexkiro

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions