title: Avro Writer in Python 3.5
body: <p>I'm attempting to create an Avro based on an existing schema, but I'm getting an error while using the syntax from the tutorial located <a href="https://avro.apache.org/docs/1.8.1/gettingstartedpython.html" rel="nofollow noreferrer">here</a>. The console is saying the 'bytes' object has no attribute 'to_json', but it's deep within the Avro library. Are there any good workarounds or ways to fix this error?</p>
  
  <p>Full error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "build_data.py", line 15, in &lt;module&gt;
  al.create_avro(logs)
  File "AppLog.py", line 57, in create_avro
  writer = DataFileWriter(open("new.avro", "wb"), DatumWriter(), schema)
  File "/usr/local/lib/python3.5/dist-packages/avro_python3-1.8.1-py3.5.egg/avro/datafile.py", line 151, in __init__
  self.SetMeta('avro.schema', str(writer_schema).encode('utf-8'))
  File "/usr/local/lib/python3.5/dist-packages/avro_python3-1.8.1-py3.5.egg/avro/schema.py", line 266, in __str__
  return json.dumps(self.to_json())
  File "/usr/local/lib/python3.5/dist-packages/avro_python3-1.8.1-py3.5.egg/avro/schema.py", line 808, in to_json
  to_dump['items'] = item_schema.to_json(names)
  AttributeError: 'bytes' object has no attribute 'to_json'
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>schema = avro.schema.ArraySchema(open("AppLogs.avsc", "rb").read())
  writer = DataFileWriter(open("new.avro", "wb"), DatumWriter(), schema)
  </code></pre>
  
  <p>Thanks for your help.</p>