bugzilla2trac fails during insert into TICKET_CHANGE - integrity error
|Reported by:||Andy Hardy||Owned by:||Jonas Borgström|
Bugzilla2trac (r3544), Bugzilla version 2.20 is running under MySQL 4.1.13 on a SuSE box, Trac 0.10.1 with sqlite is running on a Windows 2003 server.
I'm new to Trac and have never looked at Python, but hope that the enclosed details make sense to someone who understands!
The import failed with an integrity error referring to the TICKET_CHANGE table. I put some 'print' statements around the addTicketChange function to see if there was an obvious problem. It appears that the "time" returned from Bugzilla is visible (prints in the form of "YYYY-MM-DD HH24:MI:SS") , but the use of strftime('%s') against it results in a null - which eventually causes the integrity error to appear.
It seems to me that the sqlite ticket_change table is using an integer to store dates? So I guessed that it might actually be expecting something equivalent to a mktime result?
My workaround was to add a: time_mktime = mktime(strptime(time.strftime("%Y-%m-%d %H:%M:%S"), "%Y-%m-%d %H:%M:%S"))
to each function that deals with storing dates and then used the time_mktime value directly in the insert It seems to work for me.
Not sure why the original doesn't work on my setup or whether this is a proper fix, but happy to pass on to someone who knows how this is all intended to work!