Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

example gives error #4

Closed
cysouw opened this issue Oct 13, 2015 · 7 comments
Closed

example gives error #4

cysouw opened this issue Oct 13, 2015 · 7 comments

Comments

@cysouw
Copy link

cysouw commented Oct 13, 2015

I tried the bash example in the readme

clld-download-table wals.info value --parameter 1A | in2csv -f json | csvstat

It gives the following error:

Traceback (most recent call last):
File "/usr/local/bin/clld-download-table", line 11, in
sys.exit(download_table())
File "/usr/local/lib/python3.5/site-packages/clldclient/cli.py", line 40, in download_table
*_{name: getattr(args, name) for name in constraints if getattr(args, name)})
File "/usr/local/lib/python3.5/site-packages/clldclient/database.py", line 251, in table
return Table(rsc, self, strip_html=strip_html, *_constraints)
File "/usr/local/lib/python3.5/site-packages/clldclient/table.py", line 18, in init
if name in self.client.dataset.resource_types:
File "/usr/local/lib/python3.5/site-packages/clldclient/database.py", line 212, in dataset
self._dataset = Dataset(self.get(), self, 'dataset')
File "/usr/local/lib/python3.5/site-packages/clldclient/database.py", line 48, in init
assert res.mimetype == 'application/rdf+xml'
File "/usr/local/lib/python3.5/site-packages/clldclient/cache.py", line 67, in mimetype
return self.content_type.split(';')[0].strip()
File "/usr/local/lib/python3.5/site-packages/clldclient/cache.py", line 63, in content_type
return self.headers['content-type']
KeyError: 'content-type'
Expecting value: line 1 column 1 (char 0)

@xrotwang
Copy link
Member

@cysouw sorry to have put you in the early adopter role yet again. Release 1.3.1 should have fixed this problem.

@cysouw
Copy link
Author

cysouw commented Oct 14, 2015

No problem: I like guinea pigs :-)

However, also the 1.3.1 version gives an error with the example from the readme:

Traceback (most recent call last):
File "/usr/local/bin/clld-download-table", line 9, in
load_entry_point('clldclient==1.3.1', 'console_scripts', 'clld-download-table')()
File "/Users/cysouw/clldclient/clldclient/cli.py", line 40, in download_table
*_{name: getattr(args, name) for name in constraints if getattr(args, name)})
File "/Users/cysouw/clldclient/clldclient/database.py", line 251, in table
return Table(rsc, self, strip_html=strip_html, *_constraints)
File "/Users/cysouw/clldclient/clldclient/table.py", line 18, in init
if name in self.client.dataset.resource_types:
File "/Users/cysouw/clldclient/clldclient/database.py", line 212, in dataset
self._dataset = Dataset(self.get(), self, 'dataset')
File "/Users/cysouw/clldclient/clldclient/database.py", line 49, in init
self.uriref = URIRef(res.canonical_url)
File "/usr/local/lib/python3.5/site-packages/rdflib/term.py", line 206, in new
if not _is_valid_uri(value):
File "/usr/local/lib/python3.5/site-packages/rdflib/term.py", line 77, in _is_valid_uri
if c in uri: return False
TypeError: a bytes-like object is required, not 'str'
Expecting value: line 1 column 1 (char 0)

@xrotwang
Copy link
Member

Ok, I see you are on python 3.5. Haven't done any tests with this so far. On python 3.4 all tests pass - although I'm not sure the exception you are seeing would be covered by the tests.

@xrotwang xrotwang reopened this Oct 14, 2015
@xrotwang
Copy link
Member

@cysouw What version of rdflib are you using?

@xrotwang
Copy link
Member

Ah, ok. This particular error message was improved in Python 3.5. What I'm seeing in 3.2 and 3.4 is

TypeError: Type str doesn't support the buffer API

@xrotwang
Copy link
Member

Just verified that clldclient 1.3.2 with python 3.4 and the following packages works:

SQLAlchemy==1.0.8
appdirs==1.4.0
beautifulsoup4==4.4.1
clldclient==1.3.2
html5lib==0.9999999
purl==1.1
rdflib==4.2.1
requests==2.8.1
six==1.10.0
uritemplate==0.6

@cysouw
Copy link
Author

cysouw commented Oct 15, 2015

perfect! works now as expected, also on my machine
michael

On 14 Oct 2015, at 10:28, Robert Forkel notifications@github.com wrote:

Just verified that clldclient 1.3.2 with python 3.4 and the following packages works:

SQLAlchemy==1.0.8
appdirs==1.4.0
beautifulsoup4==4.4.1
clldclient==1.3.2
html5lib==0.9999999
purl==1.1
rdflib==4.2.1
requests==2.8.1
six==1.10.0
uritemplate==0.6


Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants