Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.7.7
-
None
-
None
Description
Hello,
I was just working through the Avro getting started document and noticed it is a bit out of date. Consider the following diffs.
Sincerely,
John
(py3)jkern@ubuntu:~/scratch/avro-trunk/doc/examples$ svn diff example.py
Index: example.py
===================================================================
— example.py (revision 1651542)
+++ example.py (working copy)
@@ -2,14 +2,14 @@
from avro.datafile import DataFileReader, DataFileWriter
from avro.io import DatumReader, DatumWriter
-schema = avro.schema.parse(open("user.avsc").read())
+schema = avro.schema.Parse(open("user.avsc").read())
-writer = DataFileWriter(open("/tmp/users.avro", "w"), DatumWriter(), schema)
+writer = DataFileWriter(open("/tmp/users.avro", "wb"), DatumWriter(), schema)
writer.append(
)
writer.append(
)
writer.close()
-reader = DataFileReader(open("/tmp/users.avro", "r"), DatumReader())
+reader = DataFileReader(open("/tmp/users.avro", "rb"), DatumReader())
for user in reader:
- print user
+ print (user)
reader.close()