Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when writing opil to string #193

Open
tramyn opened this issue Sep 17, 2021 · 1 comment
Open

AttributeError when writing opil to string #193

tramyn opened this issue Sep 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@tramyn
Copy link

tramyn commented Sep 17, 2021

I have an opil document I would like to write to string. I have tried using this test function as a guideline to write out sample opil data but got the following error:

python3.8/site-packages/sbol3/document.py", line 303, in write_string
    return result.decode()
AttributeError: 'str' object has no attribute 'decode'

Here is a snippet of code that can be used to reproduce this error:

from opil import *
from sbol3 import set_namespace, TextProperty, Measure, Component, TopLevel, SBOL_TOP_LEVEL
sbol.set_namespace('http://example.org')

doc = Document()
protocol = ProtocolInterface('protocol')
param = Parameter()
doc.add(protocol)
protocol.has_parameter = [param]
doc.write_string('nt')

Additional info:
I am using opil==1.0b5.post2

@tramyn tramyn added the bug Something isn't working label Sep 17, 2021
@tramyn
Copy link
Author

tramyn commented Sep 17, 2021

I did some debugging and this error is caused by using an old sbol3 release. If opil is using sbol3==1.0a8, then this AttributeError can be reproduced. But if I update Intent Parser to use sbol3==1.0b6, then this issue disappears.

Could I request a new build for opil to use sbol3==1.0b6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant