Roundup Tracker - Issues

Message6325

Author tekberg
Recipients tekberg
Date 2019-02-06.18:46:17
Message-id <1549478777.92.0.04980952079.issue2551019@roundup.psfhosted.org>
In-reply-to
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.
History
Date User Action Args
2019-02-06 18:46:19tekbergsetrecipients: + tekberg
2019-02-06 18:46:17tekbergsetmessageid: <1549478777.92.0.04980952079.issue2551019@roundup.psfhosted.org>
2019-02-06 18:46:17tekberglinkissue2551019 messages
2019-02-06 18:46:17tekbergcreate