json - Invalid Control Character Error in Python 2.7.9 -


i receiving following error when running below python script.

valueerror: invalid control character at: line 7591 column 220620 (char 385678)

i did research on , appeared resolved passing 'strict=false' within json.dumps(), i'm still receiving same error. rest service have attempted query returns error.

import arcgis import json  arcgis import arcgis service = arcgis("http://mapping.dekalbcountyga.gov/arcgis/rest/services/landuse/mapserver") query = service.get(0, count_only=false) json_query = json.dumps(query, strict=false) f = open("dekalb_parcels.geojson", "w") f.write(json_query) f.close() 

any can provided appreciated. thank you.

update - full error receiving.

traceback (most recent call last):   file "g:\python\scripts\dekalb_parcel_query.py", line 8, in <module>     query = service.get(0, count_only=false)   file "c:\python27\lib\site-packages\arcgis\arcgis.py", line 146, in     jsobj = self.get_json(layer, where, fields, count_only, srid)   file "c:\python27\lib\site-packages\arcgis\arcgis.py", line 90, in get_json     return response.json()   file "c:\python27\lib\site-packages\requests\models.py", line 802, in json     return json.loads(self.text, **kwargs)   file "c:\python27\lib\json\__init__.py", line 338, in loads     return _default_decoder.decode(s)   file "c:\python27\lib\json\decoder.py", line 366, in decode     obj, end = self.raw_decode(s, idx=_w(s, 0).end())   file "c:\python27\lib\json\decoder.py", line 382, in raw_decode     obj, end = self.scan_once(s, idx) valueerror: invalid control character at: line 7591 column 220620 (char 385678) 

i able fix issue passing strict=false within return response.json()


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -