You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/opt/easycloud_django/easypanel/views.py", line 882, in adminServerReportCsv
report_server.generate_by(CSVGenerator, filename=resp)
File "/opt/easycloud_env/lib/python2.6/site-packages/geraldo/base.py", line 435, in generate_by
return generator.execute()
File "/opt/easycloud_env/lib/python2.6/site-packages/geraldo/generators/csvgen.py", line 66, in execute
self.generate_csv()
File "/opt/easycloud_env/lib/python2.6/site-packages/geraldo/generators/csvgen.py", line 119, in generate_csv
self.writer.writerow(cells)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 3: ordinal not in range(128)
I had the same problem, and I have created my own CSVGenerator inheriting from the orginal, and overriding the method generate_csv to force self.writer.writerow([cell.encode('utf-8') for cell in cells]). This solved my problem.
Hi, got this:
When subclassing:
where
user.last_name
contains "è" or other non-ascii charThe text was updated successfully, but these errors were encountered: