confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

KafkaError.str() fails if trying to produce binary data

Open jackandrews opened this issue 9 years ago • 2 comments

Hi,

We are publishing binary data (protobufs) using confluent-kafka-python, python 2.7. If there is an error when, for example, producing data, you cannot print the error: *** UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 58: ordinal not in range(128)

E.g. to reproduce, try to produce binary data to a non-existent cluster. The callback will receive a KafkaError. err.name() will return _MSG_TIMED_OUT. Calling err.str() will throw the above exception.

Please take a look.

Thanks,

Jack

jackandrews avatar May 30 '17 11:05 jackandrews

Hi,

this is fixed in on master and will be included in the next release (end of june).

If you need the fix sooner than that you'll need to build the module from source (master).

Duplicate of #129

edenhill avatar May 30 '17 11:05 edenhill

Ah, apologies, didn't spot. Thanks for quick response!

jackandrews avatar May 30 '17 11:05 jackandrews