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

[Python] bytes field default values are incorrectly encoded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.12.0, 1.11.2
    • None
    • None
    • None

    Description

      Record fields of type 'bytes' currently utf-8 encode (the call is to '<string>'.encode() which defaults to using utf8) their default values, which (as far as I can tell) is incorrect.
      This means that if you have a bytes field with a default value of "\u00ff\u00ff", then if the defaul is used during decoding, the value b'\xc3\xbf\xc3\xbf' is returned, rather than the expected b'\xff\xff'

      Avro < 1.11 appears to do the correct thing here.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stestagg Steve Stagg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: