<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python Pro does not allow to truncate a feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-pro-does-not-allow-to-truncate-a-feature/m-p/1473140#M70592</link>
    <description>&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;We converted a Python script from ArcGIS 10.7.1&amp;nbsp; to Python Pro.&amp;nbsp; Now when we try to truncate a feature class we get the following error message:&lt;/P&gt;&lt;P&gt;Python Error occurred&lt;BR /&gt;ERROR 160592: Truncation not allowed while editing.&lt;BR /&gt;Truncation not allowed while editing.&lt;BR /&gt;Failed to execute (TruncateTable).&lt;/P&gt;&lt;P&gt;It looks like Python Pro does not behave the same way as Python ArcGIS 10.7.&lt;/P&gt;&lt;P&gt;How can we fix this error?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 19:27:24 GMT</pubDate>
    <dc:creator>SanchezNuñez</dc:creator>
    <dc:date>2024-05-15T19:27:24Z</dc:date>
    <item>
      <title>Python Pro does not allow to truncate a feature class</title>
      <link>https://community.esri.com/t5/python-questions/python-pro-does-not-allow-to-truncate-a-feature/m-p/1473140#M70592</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;We converted a Python script from ArcGIS 10.7.1&amp;nbsp; to Python Pro.&amp;nbsp; Now when we try to truncate a feature class we get the following error message:&lt;/P&gt;&lt;P&gt;Python Error occurred&lt;BR /&gt;ERROR 160592: Truncation not allowed while editing.&lt;BR /&gt;Truncation not allowed while editing.&lt;BR /&gt;Failed to execute (TruncateTable).&lt;/P&gt;&lt;P&gt;It looks like Python Pro does not behave the same way as Python ArcGIS 10.7.&lt;/P&gt;&lt;P&gt;How can we fix this error?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 19:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-pro-does-not-allow-to-truncate-a-feature/m-p/1473140#M70592</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2024-05-15T19:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python Pro does not allow to truncate a feature class</title>
      <link>https://community.esri.com/t5/python-questions/python-pro-does-not-allow-to-truncate-a-feature/m-p/1473178#M70593</link>
      <description>&lt;P&gt;The answer would be to stop editing, but without your code, the specifics are unclear here.&lt;/P&gt;&lt;P&gt;If you were manually editing the table before, save or discard those edits and try again.&lt;/P&gt;&lt;P&gt;Elsewise, if you have an editor object&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm" target="_blank" rel="noopener"&gt;Editor—ArcGIS Pro | Documentation&lt;/A&gt;, try removing it or placing the truncate outside of the edit loop if structured as&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;with&lt;/SPAN&gt;&lt;SPAN&gt; arcpy.da.Editor(workspace) &lt;/SPAN&gt;&lt;SPAN class=""&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; edit:&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;If neither of these work, post your code and we can figure it out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 20:20:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-pro-does-not-allow-to-truncate-a-feature/m-p/1473178#M70593</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-05-15T20:20:24Z</dc:date>
    </item>
  </channel>
</rss>

