Runtime error <class 'arcgisscripting.ExecuteError'> persists until you restart ArcMp

656
1
03-20-2012 04:17 AM
JT2
by
New Contributor II
I frequently encounter this error after I mess up in a script: "Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000582: Error occurred during execution."

When I then fix the script, the error persists until I restart ArcGIS. This is a pain.

For example, say I try to export and overwrite a pdf, but the pdf is still open in Adobe Acrobat. This causes an error. So I go and close Acrobat, but the script still won't run. It will only work after I restart ArcGIS, even though nothing else changes.

Why is this? How can I 'flush' arcpy so I can successfully run scripts without having to restart the app?

Thanks for your tips
Tags (2)
0 Kudos
1 Reply
MathewCoyle
Frequent Contributor
You should do your debugging outside of ArcMap. Alternatively, you can put in some error checking (such as checking if an export file exists) on frequent errors so you don't run into the problem at all. Also if you are using a script tool and you have the script embedded in the tool and you click edit, you are not editing the script that is being executed. You are editing the reference script which then needs to be reimported to be executed. This is also accomplished by restarting ArcMap which sounds like the error you are having specifically.
0 Kudos