I'm using arcpy.JSONToFeatures_conversion() to batch convert some json files to features in a gdb. Python kept running into errors (either ERROR 001558: Error parsing json file, or ERROR 999998). This was troubling since I had previously tested the input/output without issue. After a lot of troubleshooting I found the error only occurs after the json module was imported. What is the most pythonic way of dealing with this? Can anyone explain the conflict and how I might recognize/anticipate this when troubleshooting code in the future?
Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> arcpy.JSONToFeatures_conversion(in_json_file, out_features) File "C:\ArcGIS\Desktop10.3\ArcPy\arcpy\conversion.py", line 528, in JSONToFeatures raise e ExecuteError: ERROR 001558: Error parsing json file 'L:/<dir>results16870.json'. Failed to execute (JSONToFeatures).
Code Snippet (works when json isn't imported):
import arcpy import json temp_json = r"~\result1216.json" fcName = r"~\Testing.gdb\newFC" arcpy.JSONToFeatures_conversion(temp_json, fcName)