AamAadmiParty / cleansweep

Volunteer & Campaign Management System
Other
40 stars 21 forks source link

UnicodeDecodeError when downloading volunteer data #172

Closed raghavio closed 8 years ago

raghavio commented 8 years ago

Complete traceback:

Traceback (most recent call last):
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask_cors/__init__.py", line 279, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask/app.py", line 1479, in full_dispatch_request
    response = self.process_response(response)
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask/app.py", line 1691, in process_response
    response = handler(response)
  File "/Volumes/Raghav/Github/cleansweep/lib/python2.7/site-packages/flask_debugtoolbar/__init__.py", line 202, in process_response
    response_html = response.data.decode(response.charset)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 0: invalid continuation byte
raghavio commented 8 years ago

There was a typo in header. response.headers['content_type'] = 'application/vnd.ms-excel;charset=utf-8'