cubicweb #607359 wrong dateformat when using db-init on sqlite database [resolved]

File "/var/lib/python-support/python2.5/logilab/common/db.py", line 473, in execute
  self.__class__.__bases__[0].execute(self, final_sql , kwargs)
File "/var/lib/python-support/python2.5/logilab/common/db.py", line 402, in convert_mxdatetime
  return strptime(ustr, '%Y-%m-%d %H:%M:%S')
mx.DateTime.Error: strptime() parsing error at position 19: '2009-12-21 19:02:12.303158'

I used this hotfix

 diff -r 76c036bd7aec db.py
 --- a/db.py     Fri Dec 04 08:38:06 2009 +0100
 +++ b/db.py     Mon Dec 21 20:09:44 2009 +0100
 @@ -396,9 +396,11 @@ class _PySqlite2Adapter(DBAPIAdapter):
            sqlite.register_adapter(DateTimeDeltaType, adapt_mxdatetimedelta)

            def convert_mxdate(ustr):
+               ustr = ustr.split('.')[0]
                return strptime(ustr, '%Y-%m-%d %H:%M:%S')
            sqlite.register_converter('date', convert_mxdate)
            def convert_mxdatetime(ustr):
+               ustr = ustr.split('.')[0]
                return strptime(ustr, '%Y-%m-%d %H:%M:%S')
            sqlite.register_converter('timestamp', convert_mxdatetime)
            def convert_mxtime(ustr):
prioritynormal
typebug
done in3.8.5
load0.200
load left0.000
closed by<not specified>