-
Notifications
You must be signed in to change notification settings - Fork 704
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
AttributeError: 'datetime.datetime' object has no attribute 'timestamp' #666
Comments
This bug was introduced some time in the later releases, but since Python 2.7 reached its end of life almost 3 years ago, I decided not to spend a lot of time fixing it (my early attempts failed). If you are unable to switch to Python 3 for whatever reason, you need to downgrade your APScheduler to 3.8.1. |
Please update the version requirements on PyPI so that 3.9.1 doesn't appear as compatible with Python 2.7 |
I've made new post-releases for v3.9.0 and v3.9.1 (and yanked the originals). |
Things to check first
I have checked that my issue does not already have a solution in the FAQ
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Version
APScheduler 3.9.1
What happened?
D:\software\Python27\python.exe D:/pySpace/aps_test.py
Traceback (most recent call last):
File "D:/pySpace/aps_test.py", line 19, in
myAPS.start()
File "D:\software\Python27\lib\site-packages\apscheduler\schedulers\background.py", line 35, in start
BaseScheduler.start(self, *args, **kwargs)
File "D:\software\Python27\lib\site-packages\apscheduler\schedulers\base.py", line 167, in start
self._real_add_job(job, jobstore_alias, replace_existing)
File "D:\software\Python27\lib\site-packages\apscheduler\schedulers\base.py", line 863, in _real_add_job
replacements['next_run_time'] = job.trigger.get_next_fire_time(None, now)
File "D:\software\Python27\lib\site-packages\apscheduler\triggers\interval.py", line 68, in get_next_fire_time
return normalize(next_fire_time)
File "D:\software\Python27\lib\site-packages\apscheduler\util.py", line 431, in normalize
return datetime.fromtimestamp(dt.timestamp(), dt.tzinfo)
AttributeError: 'datetime.datetime' object has no attribute 'timestamp'
How can we reproduce the bug?
pip list
Package Version
APScheduler 3.9.1
funcsigs 1.0.2
futures 3.3.0
pip 20.3.4
pytz 2022.2.1
setuptools 44.1.1
six 1.16.0
tzlocal 2.1
The text was updated successfully, but these errors were encountered: