Re: roundup.cgi.actions.ExportCSVAction broken?
Tom Ekberg <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <DM6PR08MB4778790E216617BD281C83BDCA6F0@DM6PR08MB4778.namprd08.prod.outlook.com> |
Ralf,
I looked at the write function more and decided to change it to this:
def write(self, data):
f = self.request.get_wfile()
self.write = lambda data: f(data.encode('utf-8')
if isinstance(data, str) else data)
return self.write(data)
The lambda function wraps around the f call, converting its argument to utf-8 if necessary. This function works but the export doesn't handle objects well. I tried the string encode function in Python 2.7 and it returns a string that is == to the original string so this change should be backwards compatible. I did a roundup search on a tracker and got this as the result in a CSV file
id,activity,title,creator,status
476,2017-12-12.22:56:15,Datalink,33,2
330,2016-01-28.18:37:08,Unity Real Time hardware kit installation,25,3
The id, activity and title columns are fine but the creator and status values show id values. There are already 2 bugs reported on this problem. See issues 2550833, and issue 2550792 that I created. I'm going to see about applying the changes stored with issue 2550833.
[cid:0ee03776-fef6-4aba-a987-32a4f1fa9847]
_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users
Outlook-xqgykh53.jpg
(image/jpeg, 14.3 KB) - not displayed