confluentinc / confluent-kafka-python

Confluent's Kafka Python Client
http://docs.confluent.io/current/clients/confluent-kafka-python
Other
3.73k stars 882 forks source link

Python 3.6+ support? #620

Open fedenusy opened 5 years ago

fedenusy commented 5 years ago

Description

This library requires enum34, which is not compatible with Python 3.6+.

How to reproduce

Run a no-op unittest while requiring confluent-kafka and you should get something like:

Error in sitecustomize; set PYTHONVERBOSE for traceback:
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_fedenusy/82761fbb391b03a602abc1324ff91dda/sandbox/darwin-sandbox/55/execroot/com_github_softwaremotor_smc/bazel-out/darwin-fastbuild/bin/libpy/kafka/tests/test_consumer.runfiles/com_github_softwaremotor_smc/libpy/kafka/tests/test_consumer.py", line 1, in <module>
    import unittest
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/__init__.py", line 58, in <module>
    from .result import TestResult
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/result.py", line 5, in <module>
    import traceback
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/traceback.py", line 5, in <module>
    import linecache
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/linecache.py", line 11, in <module>
    import tokenize
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tokenize.py", line 33, in <module>
    import re
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

Checklist

Please provide the following information:

edenhill commented 5 years ago

This does not seem to be a problem with confluent-kafka-python, but with the enum34 package. A quick search suggests the following solution: https://stackoverflow.com/a/45716067/1821055

fedenusy commented 5 years ago

This does not seem to be a problem with confluent-kafka-python, but with the enum34 package. A quick search suggests the following solution: https://stackoverflow.com/a/45716067/1821055

Uninstalling enum34 triggers a different bug in confluent-kafka-python

On Thu, Jun 13, 2019, 2:20 AM Magnus Edenhill notifications@github.com wrote:

This does not seem to be a problem with confluent-kafka-python, but with the enum34 package. A quick search suggests the following solution: https://stackoverflow.com/a/45716067/1821055

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/confluentinc/confluent-kafka-python/issues/620?email_source=notifications&email_token=AAIB6C6P2UEBWXEH6DQHAPLP2IGORA5CNFSM4HXUO6K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXTCQFQ#issuecomment-501622806, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIB6C2SUUXHN5BCX5FTIBTP2IGORANCNFSM4HXUO6KQ .