marrow/marrow.templating — Issue #4: JSON serializer uses unicode Content-Type HTTP header
Author: aGHz
Created: 2011-11-28 21:17:01+00:00
State: open

The JSON serializer in marrow/templating/serialize/json_.py imports unicode_literals, so the default content_type 'application/json' is a unicode string. This bothers Flup, and *might* possibly go against HTTP spec.

URL: http://<...>
File 'lib/python2.7/site-packages/weberror/evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File 'lib/python2.7/site-packages/paste/registry.py', line 379 in __call__
app_iter = self.application(environ, start_response)
File 'lib/python2.7/site-packages/paste/config.py', line 105 in register_config
app_iter = application(environ, start_response)
File 'usr/src/WebCore/web/db/api.py', line 73 in __call__
result = self.application(environ, local_start)
File 'usr/src/WebCore/web/core/templating.py', line 144 in __call__
return self.response(result, environ, start_response)
File 'usr/src/WebCore/web/core/templating.py', line 95 in response
return response(environ, start_response)
File 'lib/python2.7/site-packages/paste/registry.py', line 155 in __call__
return self._current_obj()(*args, **kw)
File 'lib/python2.7/site-packages/webob/response.py', line 915 in __call__
start_response(self.status, headerlist)
File 'usr/src/WebCore/web/db/api.py', line 70 in local_start
return start_response(stat_str, headers)
File 'lib/python2.7/site-packages/weberror/evalexception.py', line 424 in detect_start_response
return start_response(status, headers, exc_info)
File 'lib/python2.7/site-packages/flup-1.0.3.dev_20110405-py2.7.egg/flup/server/fcgi_base.py', line 1150 in start_response
assert type(val) is str, 'Value of header "%s" must be a string' % name
AssertionError: Value of header "Content-Type" must be a string