PythonIreland / broadgauge

Platform for managing training/workshops
Other
0 stars 12 forks source link

Non-ascii characters in new workshop form cause 500 error #43

Open gerboland opened 9 years ago

gerboland commented 9 years ago

In the New Workshop form, If I enter a non-ascii character like æßð into the name or description text boxes, it causes a 500 error:

Traceback (most recent call last): File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/application.py", line 239, in process return self.handle() File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/application.py", line 230, in handle return self._delegate(fn, self.fvars, args) File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/application.py", line 462, in _delegate return handle_class(cls) File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/application.py", line 438, in handle_class return tocall(_args) File "/home/gerry/dev/play/pythonireland/broadgauge/broadgauge/views/orgs.py", line 86, in POST i = web.input() File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/webapi.py", line 334, in input return storify(out, requireds, _defaults) File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/utils.py", line 161, in storify value = getvalue(value) File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/utils.py", line 150, in getvalue return unicodify(x) File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/utils.py", line 141, in unicodify if _unicode and isinstance(s, str): return to_unicode(s) File "/home/gerry/dev/play/pythonireland/broadgauge/local/lib/python2.7/site-packages/web/utils.py", line 348, in safeunicode return obj.decode(encoding) File "/home/gerry/dev/play/pythonireland/broadgauge/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 0xf0 in position 0: unexpected end of data

jvalinas commented 9 years ago

In Progress.

gerboland commented 9 years ago

Note this may be a hard fix, as it appears to be happening in the web.py module. Good luck!