The MySQL datetime field supports any date > year 1000, but the use of strftime prevents you from passing a python datetime object to cursor.execute() that has a year < 1900.
File "C:\Python26\lib\site-packages\MySQLdb\cursors.py", line 151, in execute
query = query % db.literal(args)
File "C:\Python26\lib\site-packages\MySQLdb\connections.py", line 247, in lite
ral
return self.escape(o, self.encoders)
File "C:\Python26\lib\site-packages\MySQLdb\times.py", line 85, in DateTime2li
teral
return string_literal(format_TIMESTAMP(d),c)
File "C:\Python26\lib\site-packages\MySQLdb\times.py", line 40, in format_TIME
STAMP
return d.strftime("%Y-%m-%d %H:%M:%S")
ValueError: year=1601 is before 1900; the datetime strftime() methods require ye
ar >= 1900
c:\iocg\src\coordinator>
woops, forgot to mention, I"m using windows 7 with python 2.6. it may be a platform specific issue with strftime().
I've hit this bug too. It's really not acceptable since the python API docs clearly says strftime() cannot be used to format year < 1900 and there's an alternative .isoformat() method you can use. This bug currently exists on all platforms and IMHO it's quite serious. Can you quickly patch this up and release a bugfix? Thanks.
Fixed in 659