<?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 Re: arcypy.da.InsertCursor error: Python int too large to convert to C long in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496733#M39011</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan. Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had seen the SO article you referred to and and had verified that my system maxsize was sufficient to cover the date ticks from the AGOL data (I am using python 3.x). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did stumble upon a solution to the problem, however. I used&amp;nbsp; a method from the ArcREST API&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcrest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;common&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;toDateTime‍&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;to convert the ticks to a python date time object. &amp;nbsp;I then used that new datetime object in&amp;nbsp;the InsertCursor. &amp;nbsp;So far, its working as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Sep 2017 19:01:33 GMT</pubDate>
    <dc:creator>Trippetoe</dc:creator>
    <dc:date>2017-09-11T19:01:33Z</dc:date>
    <item>
      <title>arcypy.da.InsertCursor error: Python int too large to convert to C long</title>
      <link>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496731#M39009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I am trying to get data from my AGOL account and insert it into an enterprise database (SQL Server). &amp;nbsp;I get&amp;nbsp;the data via the ArcREST API from my AGOL table. I then use an arcpy.da InsertCursor to insert the data into a standalone table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am get an error on insert when the AGOL data contains a date field. The error message is "&lt;SPAN style="font-size: 11.0pt;"&gt;OverflowError: Python int too large to convert to C long".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;How can i use the arcypy InsertCursor to insert date data? Do i need to convert the 'ticks' that are returned from AGOL into a string date, e.g. '2017-09011' or some such?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 17:29:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496731#M39009</guid>
      <dc:creator>Trippetoe</dc:creator>
      <dc:date>2017-09-11T17:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: arcypy.da.InsertCursor error: Python int too large to convert to C long</title>
      <link>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496732#M39010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check your system&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/38314118/overflowerror-python-int-too-large-to-convert-to-c-long-on-windows-but-not-ma"&gt;https://stackoverflow.com/questions/38314118/overflowerror-python-int-too-large-to-convert-to-c-long-on-windows-but-not-ma&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And you are using python 2.7.x... moving to python 3 removes this distinction&amp;nbsp;&lt;A href="https://bugs.python.org/issue21816"&gt;https://bugs.python.org/issue21816&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There are thousands of links to this, some relate to using itertools.count in place of xrange (old python 2.7), but I suspect you are going to have to check sys.maxint with your values or perform the same work in Pro (uses python 3.5.x)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 18:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496732#M39010</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-09-11T18:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcypy.da.InsertCursor error: Python int too large to convert to C long</title>
      <link>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496733#M39011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan. Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had seen the SO article you referred to and and had verified that my system maxsize was sufficient to cover the date ticks from the AGOL data (I am using python 3.x). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did stumble upon a solution to the problem, however. I used&amp;nbsp; a method from the ArcREST API&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcrest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;common&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;toDateTime‍&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;to convert the ticks to a python date time object. &amp;nbsp;I then used that new datetime object in&amp;nbsp;the InsertCursor. &amp;nbsp;So far, its working as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 19:01:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcypy-da-insertcursor-error-python-int-too-large/m-p/496733#M39011</guid>
      <dc:creator>Trippetoe</dc:creator>
      <dc:date>2017-09-11T19:01:33Z</dc:date>
    </item>
  </channel>
</rss>

