Alperen Koksel created AVRO-2591:

             Summary: Getting error when reading avro message python
                 Key: AVRO-2591
             Project: Apache Avro
          Issue Type: Bug
          Components: python
    Affects Versions: 1.9.1
         Environment: Windows
            Reporter: Alperen Koksel

I can't read avro messages in python in windows environment. 
We 're using avro templates on kafka. I get the avro serialized message using 
kafkaconsumer but I can't deserialize using

// code placeholder
schema_path = "x.avsc"
schema = avro.schema.Parse(open(schema_path).read())

def from_avro(msg):
    bytes_reader = io.BytesIO(msg)
    decoder =
    reader =, schema)
    user1 =
    return user1

consumer = KafkaConsumer('avro_topic',

for msg in consumer:
// code placeholder
File "C:\Users\alpl\PycharmProjects\WorkOn\venv\lib\site-packages\avro\", 
line 240, in read_bytes
 assert (nbytes >= 0), nbytes
AssertionError: -45

I found following stackoverflow post which posted more than a year ago.


I tried several versions of avro. Results are same.


This message was sent by Atlassian Jira

Reply via email to