I am using arcpy v10.6.1 to update, in an edit session, a table stored on a Geodatabase Enterprise installed on Postgres.
The python code is used via a toolbox in ArcMap
Times to times, I have this weird error when running the tool: Runtimeerror: The operation was attempted on an empty geometry
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os
WORKSPACE <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>r<SPAN class="string token">"C:\\"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Script"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Connections"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"PostgrSQL.sde"</SPAN><SPAN class="punctuation token">)</SPAN>
SURVEY_FC <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>WORKSPACE<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SoumissionsEncombrants"</SPAN><SPAN class="punctuation token">)</SPAN>
edit <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>Editor<SPAN class="punctuation token">(</SPAN>WORKSPACE<SPAN class="punctuation token">)</SPAN>
edit<SPAN class="punctuation token">.</SPAN>startEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">#this line raises the error</SPAN>
edit<SPAN class="punctuation token">.</SPAN>startOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#here I use an update cursor on SURVEY_FC table</SPAN>
edit<SPAN class="punctuation token">.</SPAN>stopOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
edit<SPAN class="punctuation token">.</SPAN>stopEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
The error is raised by the edit.startEditing(False, False) line
I have try to set the edit.startEditing multiuser and undo parameters to True, but the same error is raised randomly.
I have to close and re-open ArcMap/ArcCatalog and run the tool again to make it works.
What could be the cause of the error?