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

Fix timestamp parsing in python 3.10+ #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Spferical
Copy link

Python 3.9 gives a deprecation warning:

$ python -c 'import datetime; import decimal; print(datetime.datetime.utcfromtimestamp(decimal.Decimal(3)))'
<string>:1: DeprecationWarning: an integer is required (got type decimal.Decimal).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
1970-01-01 00:00:03

And in python 3.10, decimal timestamp support was removed:

$ python -c 'import datetime; import decimal; print(datetime.datetime.utcfromtimestamp(decimal.Decimal(3)))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: 'decimal.Decimal' object cannot be interpreted as an integer

@kastonework
Copy link

Thanks for this update! We'd like to take this opportunity to add some unit tests, and we plan to look at this in the next couple of weeks.

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.

2 participants