Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2432

Python 3: AssertionError on reading "empty" file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.0
    • 1.10.0
    • python
    • None

    Description

      I've seen this problem with the pip package avro-python3. An AssertionError is thrown on reading certain unusual files.

      Problematic files seem to have these characteristics:

      • The file is read without issue by avro-tools
      • Normal, correct header with sync token
      • Zero records (first block_count read is zero)
      • A sync token follows the zero block_count long, then EOF

      An example file is attached.

      Repro code (nothing special):

      from avro.datafile import DataFileReader
      from avro.io import DatumReader
      
      with DataFileReader(open("28.avro", 'rb'), DatumReader()) as r:
          for rec in r:
              print(rec)
      

      Attachments

        1. patch-avro-2432.patch
          6 kB
          David Beswick
        2. 28.avro
          0.5 kB
          David Beswick

        Issue Links

          Activity

            People

              kojiromike Michael A. Smith
              dbeswick.bupa David Beswick
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: