Opened 17 years ago
Closed 17 years ago
#6794 closed defect (fixed)
bugzilla2trac.py: "Incorrect integer value" during bug import
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | general | Version: | 0.11b1 |
Severity: | normal | Keywords: | bugzilla |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
bugzilla2trac.py fails during import. Enclosed find the log and traceback.
Using Bugzilla v2180 schema. Bugzilla MySQL('bugs':'localhost':'bugzilla':''): connecting… Trac SQLite('d:\htdocs\trac'): connecting…
Cleaning all tickets… All tickets cleaned…
- Filtering products… Using products rttrd
- Import severities… inserting severity 'blocker' - '1' inserting severity 'critical' - '2' inserting severity 'major' - '3' inserting severity 'normal' - '4' inserting severity 'minor' - '5' inserting severity 'trivial' - '6'
- Import components… inserting component 'broker-flatex', owner 'andreas.balogh@…' inserting component 'mdf-consors', owner 'andreas.balogh@…' inserting component 'opportunity spotter', owner 'andreas.balogh@…' inserting component 'quote-poller', owner 'andreas.balogh@…'
- Import priorities… inserting priority 'highest' - '1' inserting priority 'high' - '2' inserting priority 'normal' - '3' inserting priority 'low' - '4' inserting priority 'lowest' - '5'
- Import versions… inserting version '0.9'
- Import milestones…
- Retrieving bugs…
- Import bugs and bug activity…
Traceback (most recent call last): File "bugzilla2trac.py", line 895, in <module> main() File "bugzilla2trac.py", line 892, in main convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN) File "bugzilla2trac.py", line 672, in convert value = desc['thetext']) File "bugzilla2trac.py", line 365, in addTicketComment (ticket, time.strftime('%s'), author, 'comment', '', comment)) File "c:\apps\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\db\util.py ", line 50, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "c:\apps\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\db\util.py ", line 50, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "C:\Apps\Python25\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\My SQLdb\cursors.py", line 166, in execute File "C:\Apps\Python25\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\My SQLdb\connections.py", line 35, in defaulterrorhandler _mysql_exceptions.OperationalError: (1366, "Incorrect integer value: '' for column 'time' at row 1")
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | bugzilla2trac_strftime.patch added |
---|
comment:1 by , 17 years ago
I've encountered the exact same issue. After some code-diving (and a little schema reverse-engineering), I solved this. bugzilla2trac is using strftime('%s') in a few places to convert datetime values to epoch-seconds. The only problem with this is that the "%s" is a Glibc extension, and is unavailable on most non-Glibc platforms (such as MS Win32, the platform I'm using).
I'm attaching a patch in which I've refactored away the strftime calls into a method which will work even on non-Glibc systems. After making this change I was able to successfully run bugzilla2trac.py on my windows system.
comment:2 by , 17 years ago
Description: | modified (diff) |
---|---|
Keywords: | bugzilla added |
Milestone: | → 0.11 |
Looks good, thanks!
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Contributed patch committed as [6501].
patch fixing issue