tlsilveus

another question - same script - previous post "new to python - trouble with ..."

Discussion created by tlsilveus on Apr 19, 2011
Latest reply on Apr 19, 2011 by tlsilveus
In my script (you can see it here http://forums.arcgis.com/threads/28628-new-to-python-trouble-with-error-trapping) I am opening a search cursor with a where clause and modifying an update cursor based on some content found in the search cursor.  Before that, I check to see if the field to modify is present, and if not I add it.  I'm seeing certain behavior and I need to understand if this is what is expected.

1) Running from WinPy, if I have the map document open with these datasets, then nothing happens.  No field addition, no update. (Understandable because the table is open)

2) Running as a script tool from within arcGIS, if I have the attribute table open, the field gets added, but not update of contents occur.

3) Running as script tool from within arcGIS, if I do not have the attribute table open, the field gets added and the contents of the field are updated.

My question is with what happens in 2 above.  I would think that it would have more of a problem adding the field than it would have updating a field if it exists.  And in 1 above, why would it behave any different with a table open and locked than the behavior seen in step 2.  I would think if a write were going to be denied because of locking issues, it would be denied in the same way for both scenarios.

Is the behavior I've observed typical locking behavior between python and arcGIS?

Outcomes