When jsonify is called on an object with a 'date' it throws:
TypeError: datetime.date(2012, 3, 30) is not JSON serializable
There is an innocuous fix - see http://stackoverflow.com/questions/455580
if hasattr(obj, 'isoformat'):
raise TypeError, 'Object of type %s with value of %s is not JSON serializable' % (type(obj), repr(obj))
And https://github.com/mitsuhiko/flask/blob/master/flask/helpers.py#L142 becomes:
json_str = json.dumps(dict(*args, **kwargs), indent=None, default=date_handler)
This strikes me as preferable to TypeError.
Alternatively, jsonify could accept a default argument that is passed to json.dumps.
See #220 which is basically asking for a more general version of the same thing.
Thanks kisielk. I was surprised this issue was not already listed, but I must have overlooked it. Closing as a duplicate.
One possible solution to issue #466.