getsentry / raven-python

Raven is the legacy Python client for Sentry (getsentry.com) — replaced by sentry-python
https://sentry.io
BSD 3-Clause "New" or "Revised" License
1.68k stars 657 forks source link

Use `skipkeys` when serializing payload #1349

Open lbolla opened 5 years ago

lbolla commented 5 years ago

See comment https://github.com/getsentry/raven-python/issues/1155#issuecomment-473423879

When serializing error data (traceback, local vars, etc.) to be sent to the backend, json.dumps is used, in raven.utils.json. json.dumps can fail, e.g. when local data has the form:

{ (): "foo" }

which cannot be serialized to json (because of the tuple key). By using json.dumps(skipkeys=True) these kind of keys will be ignored.

ohimors commented 5 years ago

@lbolla When is this going to be done? Isn't this a one-line fix? Does this product even work?

File "/usr/local/lib/python3.6/site-packages/raven/utils/json.py", line 63, in dumps\n    return json.dumps(value, cls=BetterJSONEncoder, **kwargs)\n  File "/usr/local/lib/python3.6/json/__init__.py", line 238, in dumps\n    **kw).encode(obj)\nTypeError: __init__() got an unexpected keyword argument \'encoding\'\n'
lbolla commented 5 years ago

@ohimors I've already submitted a PR ages ago: https://github.com/getsentry/raven-python/pull/1350 But I've since moved to use the new "Sentry SDK", given that "raven-python" is deprecated. I don't know if the maintainers are actively working on Raven anymore.

untitaker commented 5 years ago

I'll look into this on Monday. We still want to fix bugs in Raven.

untitaker commented 5 years ago