From 8d78fad621539dcbc2a94b361b1c5fdfab0e3345 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 16 Sep 2017 18:42:18 -0500 Subject: [PATCH] Fix data type/size issue with CSV download --- tailbone/views/master.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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