Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3: problem with encoding argument in u2eve json.dumps #36

Closed
marcindulak opened this issue Dec 14, 2016 · 2 comments
Closed

python3: problem with encoding argument in u2eve json.dumps #36

marcindulak opened this issue Dec 14, 2016 · 2 comments

Comments

@marcindulak
Copy link
Contributor

CentOS7, python 3.4.5 - have a problem with

encoded = json.dumps(eve_filter.filter(event), encoding="latin-1")

The error is not clear:

Failed to encode record as JSON: __init__() got an unexpected keyword argument 'encoding':

but looking at https://docs.python.org/3/library/json.html#basic-usage json.dumps does not have the encoding argument, and encoding in json.loads is deprecated.

jasonish added a commit that referenced this issue Dec 14, 2016
Decode the output of base64 as UTF-8 before JSON encoding.

Should fix issue #36.
@jasonish
Copy link
Owner

Should be fixed. Will wait for you to confirm before closing.

@marcindulak
Copy link
Contributor Author

Converted a few unified2 logs using u2eve and python 2.7.5, 3.4.5 on CentOS7, and python 2.6.6 on CentOS6, seems working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants