diff --git a/tailbone/views/master.py b/tailbone/views/master.py index b22f9ee4..0da39c0b 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -1398,9 +1398,9 @@ class MasterView(View): for obj in results: writer.writerow(self.get_csv_row(obj, fields)) response = self.request.response - response.text = data.getvalue().decode('utf_8') + response.body = data.getvalue() data.close() - response.content_length = len(response.text) + response.content_length = len(response.body) response.content_type = b'text/csv' response.content_disposition = b'attachment; filename={}.csv'.format(self.get_grid_key()) return response