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

10.1 Building an inverse image search service --JSONDecodeError: Invalid control character at: line 27809 column 187 (char 925739) #72

Open
mikechen66 opened this issue May 4, 2020 · 1 comment

Comments

@mikechen66
Copy link

mikechen66 commented May 4, 2020

While I run the script. It has the following message.

url = 'https://query.wikidata.org/bigdata/namespace/wdq/sparql'
data = requests.get(url, params={'query': query, 'format': 'json'}).json()


JSONDecodeError Traceback (most recent call last)
in
1 url = 'https://query.wikidata.org/bigdata/namespace/wdq/sparql'
----> 2 data = requests.get(url, params={'query': query, 'format': 'json'}).json()

~/miniconda3/lib/python3.7/site-packages/requests/models.py in json(self, **kwargs)
896 # used.
897 pass
--> 898 return complexjson.loads(self.text, **kwargs)
899
900 @Property

~/miniconda3/lib/python3.7/json/init.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
346 parse_int is None and parse_float is None and
347 parse_constant is None and object_pairs_hook is None and not kw):
--> 348 return _default_decoder.decode(s)
349 if cls is None:
350 cls = JSONDecoder

~/miniconda3/lib/python3.7/json/decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):

~/miniconda3/lib/python3.7/json/decoder.py in raw_decode(self, s, idx)
351 """
352 try:
--> 353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
355 raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Invalid control character at: line 27809 column 187 (char 925739)

@j0000r111
Copy link

same error, at another line:

JSONDecodeError: Invalid control character at: line 28534 column 112 (char 958507)

I can not however find an invalid character at the specific line:

<rdf:Description rdf:nodeID="node1g8cq7gjmx484879580">

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

No branches or pull requests

2 participants