chop-dbhi / cilantro

Official client for Harvest (http://harvest.research.chop.edu)
http://cilantro.harvest.io
Other
28 stars 8 forks source link

UnicodeDecodeError with saved query feature #724

Closed ryanjohara closed 9 years ago

ryanjohara commented 9 years ago

Among other characters, a long dash (–) in the "Email Message" field in the "Save/Share Query" modal results in a 500 error:

UnicodeDecodeError at /api/queries/
'ascii' codec can't decode byte 0xe2 in position 130: ordinal not in range(128)
...
Traceback:
File "/home/devuser/webapps/pcgc-env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  113.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/devuser/webapps/pcgc-env/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/home/devuser/webapps/pcgc-env/lib/python2.7/site-packages/restlib2/resources.py" in __call__
  269.         return self.dispatch(request, *args, **kwargs)
File "/home/devuser/webapps/pcgc-env/lib/python2.7/site-packages/restlib2/resources.py" in dispatch
  274.         response = self.process_request(request, *args, **kwargs)
File "/home/devuser/webapps/pcgc-env/lib/python2.7/site-packages/restlib2/resources.py" in process_request
  786.                     data = serializers.decode(content_type, request.body.decode())

Exception Type: UnicodeDecodeError at /api/queries/
Exception Value: 'ascii' codec can't decode byte 0xe2 in position 130: ordinal not in range(128)
naegelyd commented 9 years ago

Can you please post the full stack trace? I suspect this is a Serrano issue.

-Don

On Thu, Oct 9, 2014 at 3:29 PM, ryanjohara notifications@github.com wrote:

Among other characters, a long dash (–) in the "Email Message" field in the "Save/Share Query" modal results in a 500 error:

UnicodeDecodeError at /api/queries/ 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128)

— Reply to this email directly or view it on GitHub https://github.com/cbmi/cilantro/issues/724.

Best Regards,

Donald Naegely

ryanjohara commented 9 years ago

Comment has been updated with the full stack trace.

naegelyd commented 9 years ago

I don't think this is a Cilantro issue since Cilantro just accepts the input and ships it off to the server for processing. This might be a case where restlib2 needs to set the encoding and possibly errors when decoding. I'm going to close this here. @ryanjohara I would report this on restlib2 for consideration there(link back to this issue for context).