Bugs item #1757262, was opened at 2007-07-19 20:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1757262&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQLite
Group: SQLObject release (specify)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: DateCols break for years <1000 on SQLite
Initial Comment:
I'm using SQLObject 0.9.0 with a SQLite database. If I have the schema:
class Test(SQLObject):
val = DateCol()
and try to create an instance with the year < 1000:
x = Test(val=date(900, 2, 1))
I get an exception:
formencode.api.Invalid: expected a date/time string of the '%Y-%m-%d' format in the DateTimeCol 'val', got <type 'str'> ' 900-02-01' instead
I traced this to converters.py; on my Ubuntu 7.04 system, at least, time.strftime requires leading zeros for %Y, while the DateTimeConverter and DateConverter generate the year with the format string %4d.
Changing the two format strings to use %04d fixed the bug for me.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1757262&group_id=74338
|