roundup.cgi.actions.ExportCSVAction broken?

Tom Ekberg <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <DM6PR08MB47780F6883CEBA58516AAFF4CA6E0@DM6PR08MB4778.namprd08.prod.outlook.com>
I'm running the roundup tip and trying to export to a CSV while being in the home page of a tracker. In the config.ini file I set web.debug=yes. The error I get is:


  TypeError: byte string value expected, value of type str found


It is in the write method of the Writer class in roundup/cgi/wsgi_handler.py. I'm running Python 3.5.2. The data being written is a string:


'title,priority,activity,mdx_id,specimen_description,activity,assignedto,reviewedby,keyword\r\n'


I attached the HTML for the stack trace. I had to compress it using gzip because the size of this message would exceed 40K if I didn't.


If I were to guess, I'd say this is a python 2.7 - 3.5 incompatibility issue. Probably using the string encode function is needed if the arg is a string. I'd suggest changing the above write method to something like this:


    def write(self, data):
        f = self.request.get_wfile()
        self.write = f
        return f(data.encode('utf-8') if isinstance(data, str) else data)

Is it just me or have you seen this problem too?


[cid:e83c406b-6643-4906-a068-8c21923c7cfe]

_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users
Outlook-lilhpziv.jpg (image/jpeg, 14.3 KB) - not displayed
query.html.gz (application/x-gzip, 3.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.