whit537/mongs — Issue #6: Internal server error attempting to render binary to JSON
Author: jaraco
Created: 2012-01-12 16:22:21+00:00
State: open

I have a database created with this record:

import pymongo.binary
coll = pymongo.Connection().mongs.issue6
coll.insert({'foo': range(100) + [pymongo.binary.Binary('\x00')]})

When I view it in mongs, the 'foo' field is linked as a separate view, to be rendered as JSON. When it is rendered, it fails to render with a UnicodeDecodeError. It passes the binary value to json and is unable to render the Binary field as json.