Select to view content in your preferred language

arcpy crashing mid-process

987
2
01-02-2013 01:17 PM
JamieKass
Regular Contributor
I've had multiple experiences where arcpy crashes for no apparent reason as I'm running my code. Usually, it happens when I attempt to run a tool on the product of another tool. This time around, the problem is running MultipartToSinglepart on a Union product in a feature dataset, attempting to output to a different file geodatabase. This step occurs after I've completed the entire process for one feature class, and I am attempting to run it again on another one with different names. When I run this particular case again after the Python engine has been restarted, it runs to completion. As the Python engine itself crashes when it errors, I get no informative message as to what occurred and why.
For some background on my code, as I have taken a few safety measures already, I delete all cursor objects, delete all layers after their utility has run up, and am working in a file geodatabase. Is there anything else that may be lingering in my file geodatabase after some processing that will make Python crash so hard? If there is a fix, I'd like to try and implement it.
Tags (2)
0 Kudos
2 Replies
MichaelVolz
Esteemed Contributor
Can you add some debugging to your python script to see if variables are getting passed the expected values, especially after the initial loop of your script?
0 Kudos
JamieKass
Regular Contributor
I managed to get around this particular problem by throwing in a couple of RepairGeometry's after some geoprocessing steps. This technique works I suppose, but it brings up a new question: why does ArcGIS produce geometry errors after operations like Erase and Union? Shouldn't the product be free of errors? I suppose there is no internal error checking before the output is returned.
0 Kudos