aiokafka icon indicating copy to clipboard operation
aiokafka copied to clipboard

async with AIOKafkaProducer() fails with AttributeError

Open moio opened this issue 5 years ago • 0 comments

Describe the bug

async with AIOKafkaProducer(...) as producer:
    producer.send(...)

fails with AttributeError: 'NoneType' object has no attribute 'send'. producer is indeed None.

Expected behaviour

producer is an AIOKafkaProducer object.

Environment (please complete the following information):

  • aiokafka version (python -c "import aiokafka; print(aiokafka.__version__)"): 0.7.0
  • kafka-python version (python -c "import kafka; print(kafka.__version__)"): 2.0.2
  • Kafka Broker version (kafka-topics.sh --version): 2.6.0
  • Other information (Confluent Cloud version, etc.): none relevant

Reproducible example

async with AIOKafkaProducer(...) as producer:
    producer.send(...)

moio avatar Nov 13 '20 22:11 moio