dcramer/raven — Issue #21: Error when varmap contains unicode keys
Author: rslinckx
Created: 2011-11-17 10:32:40+00:00
State: open

Let's assume the following call:

def foo(**kwargs):
raise ValueError

foo(**{u'éééé': 'éééé'})

This will trigger an exception, but raven will try to print the dict using raven/utils/encoding.py:85

ret = dict((str(k), transform_rec(v)) for k, v in value.iteritems())

This assumes the keys in a dict are str, but in this case it's an unicode string and thus will fail to decode as ascii.

Raven shouldn't assume keys in a dict are str but should encode/use the repr of the key when it's unicode