mumrah/kafka-python — pull request #224 by brutasse (2014-09-02 11:32:35+00:00)
Title: Python 3 support

Hello,

I've worked on a python3-compatible branch. The goal is to have compatibility with Python 2.6-2.7 and 3.3-3.4 with the same codebase.

Most changes are actually in tests. Python 3 being stricter at bytes vs. text handling, we need to send actual bytes to Kafka. I've assumed it's safer to let the user encode data before passing it, instead of automatically using an UTF-8 encoding when seeing unicode data.

There are two remaining failing tests on Python 3: the async/multiprocessing consumer onces. I found them quite painful to debug…

I'm not planning to continue to work on it but feel free to use this branch as a starting point. Perhaps someone more familiar with the codebase can fix the remaining failing tests.