[issue2551019] roundup.cgi.actions.ExportCSVAction broken for python3

Tom Ekberg <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Tom Ekberg:

Problem: exporting to a CSV file fails when using python3

Repeat by:
Install roundup using python3.
  * Bring up a tracker,
  * click 'home' unless already there,
  * click 'Download as CSV'

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

Location of failure:
  write method of the Writer class in roundup/cgi/wsgi_handler.py

Cause of error:
  Python3 expects the argument to the write method to be a byte string
(e.g. b'somestring') where python 2.7 expects a string.

Solution:
Change the write method to convert the string using the encode function
for utf-8. In python 2.7 this encode function returns a string which is
== to the argument. In python 3 it returns a byte string. The attached
hg diff file contains the details.

----------
components: Infrastructure, Web interface
files: wsgi_handler.py.hgdiff
messages: 6325
nosy: tekberg
severity: normal
status: new
title: roundup.cgi.actions.ExportCSVAction broken for python3
versions: devel

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551019>
_________________________________________________
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.