DOsinga / deep_learning_cookbook

Deep Learning Cookbox
Apache License 2.0
689 stars 337 forks source link

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

Open mikechen66 opened 4 years ago

mikechen66 commented 4 years ago

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 commented 2 years ago

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">