Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

#8546 closed defect (duplicate)

bugzilla2trac.py: Attachments are copied incorrectly

Reported by: remke.rutgers@… Owned by: Jeroen Ruigrok van der Werven
Priority: normal Milestone:
Component: ticket system Version: none
Severity: normal Keywords: bugzilla2trac
Cc: remke.rutgers@… Branch:
Release Notes:
API Changes:

Description

I am using bugzilla2trac.py to convert existing bugzilla data into Trac and it works quite nice. I did have an issue with attachments however. The software versions I am using are (and I cannot upgrade, because I am not the system administrator):

  • Python: 2.3.4
  • Bugzilla: 3.0.2
  • Mysql: 4.0.18
  • Trac: 0.10.4
  • bugzilla2trac.py: revision 8272
  • MySQL-python: 1.2.1_p2

In my bugzilla2trac.py I used: BZ_VERSION = 2233

The script works, but all attachments are corrupt. Instead of the original bytes, I see the array representation in the newly created attachments. A gif file starts for example:

array('c', 'GIF89aD\x02\xff\x00\xf7\x00\x00\x00\x00\x00\x00+S\x0 …..

I am a complete Python newbie, but managed to get correct attachments by changing:

line 436	        filedata = StringIO.StringIO(a['thedata'])

into:

filedata = StringIO.StringIO(a['thedata'].tostring())

Apparently,

a['thedata']

is a character array and StringIO.StringIO uses str(buffer) to construct a file object.

By the way (don't know if it is relevant): the data column in my 'attach_data' bugzilla table is a LONGBLOB and the table itself is a MyISAM table.

My change to line 436 works, but I don't understand why it is necessary. Is it simply because I am using old versions of Python or Trac? Is it because I am using a newer version of Mysql or a newer version of Bugzilla than anticipated?

Personally, I can manage with my local change as a workaround, but I would like somebody who really understands how things are working to judge if my change should be applied as a patch (or not).

Attachments (0)

Change History (6)

comment:1 by anonymous, 10 years ago

Owner: changed from Jeroen Ruigrok van der Werven to anonymous
Status: newassigned

comment:2 by anonymous, 10 years ago

Resolution: fixed
Status: assignedclosed

comment:3 by Remy Blank, 10 years ago

Resolution: fixed
Status: closedreopened

comment:4 by Remy Blank, 10 years ago

Owner: changed from anonymous to Jeroen Ruigrok van der Werven
Status: reopenednew

comment:5 by remke.rutgers@…, 10 years ago

I think the issue I posted here is exactly the same as #6792.

comment:6 by Christian Boos, 10 years ago

Resolution: duplicate
Status: newclosed

So, it's a duplicate…

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeroen Ruigrok van der Werven.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Jeroen Ruigrok van der Werven to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.