<?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 Decompressing multiple KMZs errors in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/decompressing-multiple-kmzs-errors/m-p/788766#M1530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to able to read multiple KMZs to read each doc.kml for ExtendedData/Data to populate the KMLToLayer Feature class's Attribute Table. I have wired up a 'File' control in my ArcToolbox and have it configured for multiple input. When I make the call zipfile.ZipFile(kmzFile, 'r') below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kmzInput = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;kmzFiles = kmzInput.split(';')&lt;/P&gt;&lt;P&gt;for kmzFile in kmzFiles:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;-----kmzFile is of type 'str'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tempOut=tempfile.mkdtemp()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; zf=zipfile.ZipFile(kmzFile, 'r')&amp;nbsp; &amp;lt;------ crashes here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.fp = io.open(file, filemode)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OSError: [ Errno 22] Invalid argument: " 'C:\\work\\ArcpyTestData\foo.kmz' "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, the path to the KMZ DOES EXIST. I am running ArcPro 2.0.1. Any help is much appreciated&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;V/R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Feb 2019 17:19:19 GMT</pubDate>
    <dc:creator>RobertHarvey</dc:creator>
    <dc:date>2019-02-25T17:19:19Z</dc:date>
    <item>
      <title>Decompressing multiple KMZs errors</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/decompressing-multiple-kmzs-errors/m-p/788766#M1530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to able to read multiple KMZs to read each doc.kml for ExtendedData/Data to populate the KMLToLayer Feature class's Attribute Table. I have wired up a 'File' control in my ArcToolbox and have it configured for multiple input. When I make the call zipfile.ZipFile(kmzFile, 'r') below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kmzInput = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;kmzFiles = kmzInput.split(';')&lt;/P&gt;&lt;P&gt;for kmzFile in kmzFiles:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;-----kmzFile is of type 'str'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tempOut=tempfile.mkdtemp()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; zf=zipfile.ZipFile(kmzFile, 'r')&amp;nbsp; &amp;lt;------ crashes here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.fp = io.open(file, filemode)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OSError: [ Errno 22] Invalid argument: " 'C:\\work\\ArcpyTestData\foo.kmz' "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, the path to the KMZ DOES EXIST. I am running ArcPro 2.0.1. Any help is much appreciated&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;V/R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2019 17:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/decompressing-multiple-kmzs-errors/m-p/788766#M1530</guid>
      <dc:creator>RobertHarvey</dc:creator>
      <dc:date>2019-02-25T17:19:19Z</dc:date>
    </item>
  </channel>
</rss>

