I noticed an issue when I use the serialize function from the ProvDocument with the destination parameter set and the format parameter set as 'provn'. It creates an error.
For example, this returns a TypeError Exception :
from prov.model import ProvDocument
d = ProvDocument()
d.add_namespace('ex','example.com')
d.activity('ex:read')
d.serialize(destination='./test.provn', format='provn')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "prov-1.5.3-py3.7.egg/prov/model.py", line 2404, in serialize
serializer.serialize(stream, **args)
File "prov-1.5.3-py3.7.egg/prov/serializers/provn.py", line 28, in serialize
stream.write(provn_content)
TypeError: a bytes-like object is required, not 'str'
I found that the stream condition isinstance() at line 26 of provn.py is not the right one.
It should be if isinstance(stream, io.BufferedWriter): instead of if isinstance(stream, io.BytesIO):.
I noticed an issue when I use the serialize function from the ProvDocument with the destination parameter set and the format parameter set as 'provn'. It creates an error.
For example, this returns a TypeError Exception :
I found that the stream condition isinstance() at line 26 of provn.py is not the right one. It should be
if isinstance(stream, io.BufferedWriter):
instead ofif isinstance(stream, io.BytesIO):
.