Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

'encoding' cannot be specified in python 3 #1155

Description

@jonapich

kwargs['encoding'] = 'safe-utf-8'

The 'json.dumps' command no longer have an encoding argument in python 3 and causes this stacktrace:

File "/usr/local/lib/python3.6/site-packages/raven/handlers/logging.py", line 89, in emit
 return self.emit(record)
 File "/usr/local/lib/python3.6/site-packages/raven/handlers/logging.py", line 182, in _emit
 *kwargs)
 File "/usr/local/lib/python3.6/site-packages/raven/base.py", line 645, in capture
 self.send(*data)
 File "/usr/local/lib/python3.6/site-packages/raven/base.py", line 740, in send
 message = self.encode(data)
 File "/usr/local/lib/python3.6/site-packages/raven/base.py", line 782, in encode
 return zlib.compress(json.dumps(data).encode('utf8'))
 File "/usr/local/lib/python3.6/site-packages/raven/utils/json.py", line 51, in dumps
 return json.dumps(value, cls=BetterJSONEncoder, **kwargs)
 File "/usr/local/lib/python3.6/json/init.py", line 238, in dumps
 **kw).encode(obj)
TypeError: __init_() got an unexpected keyword argument 'encoding'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions