Skip to content

Conversation

@rmihael
Copy link
Contributor

@rmihael rmihael commented Dec 29, 2017

I stumbled upon the problem similar to vklochan/python-logstash#30 while using python-logstash-async with https://github.com/madzak/python-json-logger on Python 3.6:

Traceback (most recent call last):
  File "/Users/rmihael/Documents/Projects/trade/python-logstash-async/logstash_async/handler.py", line 68, in emit
    data = self._format_record(record)
  File "/Users/rmihael/Documents/Projects/trade/python-logstash-async/logstash_async/handler.py", line 127, in _format_record
    return self.formatter.format(record) + b'\n'
TypeError: must be str, not bytes

Returning text type instead of bytes from format seems normal to me. Handler appears to be a proper place to handle encoding.


This change is Reviewable

@rmihael
Copy link
Contributor Author

rmihael commented Jan 8, 2018

Hi! Have you had any chance to review this PR?

@eht16
Copy link
Owner

eht16 commented Jan 10, 2018

Not yet but will do in a few days. Stay tuned, sorry for the delay.

@eht16 eht16 merged commit 163009b into eht16:master Jan 14, 2018
@eht16
Copy link
Owner

eht16 commented Jan 14, 2018

Looks good to me, thanks.

@rmihael
Copy link
Contributor Author

rmihael commented Jan 14, 2018

Great! Will you make a release with this fix anytime soon?

@eht16
Copy link
Owner

eht16 commented Jan 20, 2018

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

Successfully merging this pull request may close these issues.

2 participants