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

Python 3 rdfpipe: str vs. bytes error #375

Closed
dbs opened this issue Mar 26, 2014 · 0 comments · Fixed by #377
Closed

Python 3 rdfpipe: str vs. bytes error #375

dbs opened this issue Mar 26, 2014 · 0 comments · Fixed by #377

Comments

@dbs
Copy link
Contributor

dbs commented Mar 26, 2014

Running Python 3.3.2 on Fedora 20, having created a python3 virtualenv, installing either rdflib 4.1.1 or current master from git (f981fdb); using rdfpipe runs into a classic Python 3 str vs. bytes problem :

Finished processing dependencies for rdflib==4.2-dev
(rdflib3)[evergreen@localhost rdflib-git]$ rdfpipe -i rdfa1.1 http://schema.org/Thing
Traceback (most recent call last):
File "/home/evergreen/rdflib3/bin/rdfpipe", line 9, in
load_entry_point('rdflib==4.2-dev', 'console_scripts', 'rdfpipe')()
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/tools/rdfpipe.py", line 177, in main
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/tools/rdfpipe.py", line 53, in parse_and_serialize
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/graph.py", line 939, in serialize
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/plugins/serializers/turtle.py", line 201, in serialize
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/plugins/serializers/n3.py", line 40, in startDocument
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/plugins/serializers/turtle.py", line 260, in startDocument
File "/home/evergreen/rdflib3/lib/python3.3/site-packages/rdflib-4.2_dev-py3.3.egg/rdflib/plugins/serializers/turtle.py", line 134, in write
TypeError: must be str, not bytes

dbs added a commit to dbs/rdflib that referenced this issue Mar 31, 2014
Closes RDFLib#375

Signed-off-by: Dan Scott <dan@coffeecode.net>
dbs added a commit to dbs/rdflib that referenced this issue Mar 31, 2014
Due to sys.stdout being string mode in Python 3 and all of the serializing
happening in bytes mode, we need to open sys.stdout.buffer instead to avoid the
exception "TypeError: must be str, not bytes". Closes RDFLib#375.

Signed-off-by: Dan Scott <dan@coffeecode.net>
dbs added a commit to dbs/rdflib that referenced this issue Apr 2, 2014
Due to sys.stdout being string mode in Python 3 and all of the serializing
happening in bytes mode, we need to open sys.stdout.buffer instead to avoid the
exception "TypeError: must be str, not bytes". Closes RDFLib#375.

Signed-off-by: Dan Scott <dan@coffeecode.net>
joernhees added a commit that referenced this issue Jan 28, 2016
…587, #443, #444, #445

* microdata-to-rdf-third-edition:
  some whitespace cleanup
  updated microdata test for #375 wrt. #587 (microdata-rdf 2014)
  modified microdata test for #375 wrt. isomorphism and better output
  updated MicrodataParser to reflect that pyMicrodata no longer has vocab expansion and cache args
  syncing changes from pyMicrodata rev c760db0e77c13c4e80fdef675f3c65497f8d08bf
joernhees added a commit to joernhees/rdflib that referenced this issue Jan 29, 2017
* 5.0.0-dev:
  cleanup - kicking and screaming into 2017
  restrict travis to supported versions
  removed compat code for supporting legacy python versions
  Added the csvw prefix to the RDFa initial context.
  some whitespace cleanup
  updated microdata test for RDFLib#375 wrt. RDFLib#587 (microdata-rdf 2014)
  modified microdata test for RDFLib#375 wrt. isomorphism and better output
  updated MicrodataParser to reflect that pyMicrodata no longer has vocab expansion and cache args
  syncing changes from pyMicrodata rev c760db0e77c13c4e80fdef675f3c65497f8d08bf
  drop deprecated SPARQLStore(..., bNodeAsURI) arg
  drop deprecated sparqlstore.localName
  drop deprecated sparqlstore.TraverseSPARQLResultDOM
  drop deprecated sparqlstore.CastToTerm
  start of 5.0.0-dev branch
  removed md5_term_hash, fixes RDFLib#240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant