diff options
author | Viktor StÃskala <viktor@stiskala.cz> | 2013-09-11 18:09:57 +0200 |
---|---|---|
committer | Viktor StÃskala <viktor@stiskala.cz> | 2013-09-11 18:22:30 +0200 |
commit | 2839f97c609af35f61ad9125f6aa708b035bb45b (patch) | |
tree | d2a4b40f54a2340c46dd9511c7dfda1001f7cf26 | |
parent | c0362c6025f54312acc9cc0954e7dfed0852a189 (diff) | |
download | raven-2839f97c609af35f61ad9125f6aa708b035bb45b.tar.gz |
Fixed TypeError when serializing 'bytes' in Python 3
-rw-r--r-- | raven/utils/json.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/raven/utils/json.py b/raven/utils/json.py index 8599e24..654f019 100644 --- a/raven/utils/json.py +++ b/raven/utils/json.py @@ -30,6 +30,8 @@ class BetterJSONEncoder(json.JSONEncoder): return obj.strftime('%Y-%m-%dT%H:%M:%SZ') elif isinstance(obj, (set, frozenset)): return list(obj) + elif isinstance(obj, bytes): + return obj.decode('utf-8', errors='replace') return super(BetterJSONEncoder, self).default(obj) |