vendredi 8 mai 2015

Python: datetime.date "expected datetime, got int"

So, for a long time now, I have been using code like the following in Python for version tracking:

...
import datetime
...

"""
Version tracking
"""
__version__ = 4.0
__dateV__ = datetime.date(2015, 5, 7)
...

Now, out of the blue, I get an error saying "TypeError: descriptor 'date' requires a 'datetime.datetime' object but received a 'int'"

This has never happened before, and the documentation for the datetime module says that a "date" object should be initialized with year, month, and day arguments, which are all INTEGERS.

I have confirmed that I am using Python version 2.7.

Has anyone else seen this error? This is literally at the top of my code (right after all of the imports.) Please help.

Aucun commentaire:

Enregistrer un commentaire