You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bootstrap uses syntax not acceptable on Python 3 and there are fairly basic Python 3 syntax errors in the anzsrc library.
With my four "basic" Python 3 PRs (bootstrap, next, print, unicode), there is still one Python 3 problem remaining with using rdflib 3 and 4. It is a little less basic, so here is the problem when using rdflib 3
$ ./bin/genanzsrc
...
Traceback (most recent call last):
File "./bin/genanzsrc", line 12, in <module>
sys.exit(anzsrc.scripts.genanzsrc.main())
File "../src/anzsrc/src/anzsrc/scripts/genanzsrc.py", line 27, in main
genoutput(seo.genseo, 'seo', SEO)
File "../src/anzsrc/src/anzsrc/scripts/genanzsrc.py", line 14, in genoutput
g.serialize(f, format='xml')
File "../site-packages/rdflib/graph.py", line 777, in serialize
serializer.serialize(stream, base=base, encoding=encoding, **args)
File "../site-packages/rdflib/plugins/serializers/rdfxml.py", line 49, in serialize
write('<?xml version="1.0" encoding="%s"?>\n' % self.encoding)
File "../site-packages/rdflib/plugins/serializers/rdfxml.py", line 46, in <lambda>
self.write = write = lambda uni: stream.write(uni.encode(encoding, 'replace'))
TypeError: must be str, not bytes
... and the same occurs with rdflib 4 with a slightly different backtrace
$ ./bin/genanzsrc
Traceback (most recent call last):
File "./bin/genanzsrc", line 12, in <module>
sys.exit(anzsrc.scripts.genanzsrc.main())
File "../src/anzsrc/src/anzsrc/scripts/genanzsrc.py", line 27, in main
genoutput(seo.genseo, 'seo', SEO)
File "../src/anzsrc/src/anzsrc/scripts/genanzsrc.py", line 14, in genoutput
g.serialize(f, format='xml')
File ".../site-packages/rdflib/graph.py", line 946, in serialize
serializer.serialize(stream, base=base, encoding=encoding, **args)
File ".../site-packages/rdflib/plugins/serializers/rdfxml.py", line 55, in serialize
write('<?xml version="1.0" encoding="%s"?>\n' % self.encoding)
File ".../site-packages/rdflib/plugins/serializers/rdfxml.py", line 52, in <lambda>
uni.encode(encoding, 'replace'))
TypeError: must be str, not bytes
This is fixed by specifying that the serialisation file needs to be binary.
The bootstrap uses syntax not acceptable on Python 3 and there are fairly basic Python 3 syntax errors in the anzsrc library.
With my four "basic" Python 3 PRs (bootstrap, next, print, unicode), there is still one Python 3 problem remaining with using rdflib 3 and 4. It is a little less basic, so here is the problem when using rdflib 3
... and the same occurs with rdflib 4 with a slightly different backtrace
This is fixed by specifying that the serialisation file needs to be binary.
With all the
py3-x
PRs, it 'works' on Python 3:https://travis-ci.org/jayvdb/anzsrco/builds/120541306
(more testing is probably needed to confirm the output is 100% correct.
The text was updated successfully, but these errors were encountered: