<?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: Error exporting files with python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560026#M43803</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You maybe have solved your problem by now, but if not, here is a suggestion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are getting the error in the &lt;STRONG&gt;except&lt;/STRONG&gt; clause, maybe the root cause is really the problem, and you need to find out where the exception is actually being raised.&amp;nbsp; You could temporarily remove the &lt;STRONG&gt;try:&lt;/STRONG&gt; and &lt;STRONG&gt;except:&lt;/STRONG&gt; to expose where the exception is really occurring.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2014 05:24:33 GMT</pubDate>
    <dc:creator>ElleryChan</dc:creator>
    <dc:date>2014-08-04T05:24:33Z</dc:date>
    <item>
      <title>Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560017#M43794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a python script that copies image raster files selected through a defined polygon to another folder.&lt;/P&gt;&lt;P&gt;It works quite well with few tiles, but with a larger amount I get the following message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 4: ordinal not in range(128)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does this mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:12:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560017#M43794</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-07-16T13:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560018#M43795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It means that you have some special characters in there somewhere (u'\xfc' is 'ü', I believe) that need to be handled as unicode. Standard string operators in python doesn't handle unicode. It's hard to be more specific without any code or data...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560018#M43795</guid>
      <dc:creator>HåvardMoe</dc:creator>
      <dc:date>2014-07-16T13:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560019#M43796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;The simple answer is encoding conflict. The current file has som&lt;SPAN style="color: #3d3d3d;"&gt;e&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt; funky &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;f&lt;/SPAN&gt;oreign Unicode characters. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Parsing the file is great, but encoding it back out in standard 'ascii' codec it will not recognize the funky foreign character, because it doesn't fit within the range of 128 code points.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:31:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560019#M43796</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-16T13:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560020#M43797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the answers.&lt;/P&gt;&lt;P&gt;What I didn`t get is that it works for 194 files (wold files inculded) and stops then with the error message?&lt;/P&gt;&lt;P&gt;I think there's no funky foreign character?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;/P&gt;&lt;P&gt;import arcpy, os, sys, shutil, glob&lt;/P&gt;&lt;P&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Clip Feature definieren&lt;/P&gt;&lt;P&gt;AuswahlFeature = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;StrOutPath = arcpy.GetParameterAsText(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp_export_raster = StrOutPath&lt;/P&gt;&lt;P&gt;export_raster = StrOutPath&lt;/P&gt;&lt;P&gt;Ortho_Blattschnitt = "U:\\ArcUISTools15\\Data\\UIS_RIPS.gdb\\UIS_0100000017200001"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blattschnitt = "Blattschnitt"&lt;/P&gt;&lt;P&gt;Auswahl_Layer = "Export_Fläche_L"&lt;/P&gt;&lt;P&gt;SelektionsLayer = "Blattschnitt"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Output shape definieren&lt;/P&gt;&lt;P&gt;Orthos_Nummern_shp = StrOutPath + "\\Orthos_Nummern.shp"&lt;/P&gt;&lt;P&gt;FeldHinzugefuegt = StrOutPath + "\\Orthos_Nummern.dbf"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# AuswahlFeature = sys.argv[0]&lt;/P&gt;&lt;P&gt;print AuswahlFeature&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(AuswahlFeature)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Feature-Layer erstellen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(Ortho_Blattschnitt, Blattschnitt, "\"KB\" &amp;gt;= 'L6316'", "", "OBJECTID OBJECTID VISIBLE NONE;SHAPE SHAPE VISIBLE NONE;FFC FFC VISIBLE NONE;OAC OAC VISIBLE NONE;GEOM_ID GEOM_ID VISIBLE NONE;OBJECT_ID OBJECT_ID VISIBLE NONE;KB KB VISIBLE NONE;STAND STAND VISIBLE NONE;BILDFLUG BILDFLUG VISIBLE NONE;OBJECT_ID_1 OBJECT_ID_1 VISIBLE NONE;KB_1 KB_1 VISIBLE NONE;STAND_1 STAND_1 VISIBLE NONE;SHAPE_Length SHAPE_Length VISIBLE NONE;SHAPE_Area SHAPE_Area VISIBLE NONE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Feature-Layer erstellen (2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(AuswahlFeature, Auswahl_Layer, "", "", "FID FID VISIBLE NONE;Shape Shape VISIBLE NONE;Id Id VISIBLE NONE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Layer lagebezogen auswählen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByLocation_management(Blattschnitt, "intersect", Auswahl_Layer, "", "NEW_SELECTION") # "have_their_center_in"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Features kopieren&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(Blattschnitt, Orthos_Nummern_shp, "", "0", "0", "0")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Feld hinzufügen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(Orthos_Nummern_shp, "Pfad", "TEXT", "", "", "200", "", "NON_NULLABLE", "NON_REQUIRED", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Feld berechnen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(FeldHinzugefuegt, "Pfad", "\"U:\\rips\\images\\dop_color\" &amp;amp; \"\\\" &amp;amp; [KB] &amp;amp; \"\\\" &amp;amp; [OBJECT_ID]&amp;amp; \".*\"", "VB", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Table to dBASE (multiple)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.TableToDBASE_conversion(FeldHinzugefuegt, export_raster)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Prints the tiles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(Orthos_Nummern_shp)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.Pfad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # arcpy.CopyRaster_management(row.Pfad,temp_export_raster,"DEFAULTS","","","","","")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for file in glob.glob(row.Pfad):&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; shutil.copy(file, temp_export_raster)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; del Blattschnitt, Auswahl_Layer, SelektionsLayer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # ggf kann noch ein Raster Catalog erstellt werden&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred while running a tool print the messages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 14:09:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560020#M43797</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-07-16T14:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560021#M43798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course it is just a guess without having the raster images. I wonder if these rasters were made with some other software not ArcGIS. I would guess that if they were created using ArcGIS that it might not throw this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something is encoded with a different codec.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 14:36:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560021#M43798</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-16T14:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560022#M43799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error messag eshould tell you which line of the code it crashes on - that should give you a hint to where the culprit character comes into the picture.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 14:50:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560022#M43799</guid>
      <dc:creator>HåvardMoe</dc:creator>
      <dc:date>2014-07-16T14:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560023#M43800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It this - last code line&lt;/P&gt;&lt;P&gt;print arcpy.GetMessages()&lt;/P&gt;&lt;P&gt;???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 13:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560023#M43800</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-07-17T13:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560024#M43801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Johannes Bierer wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I wrote a python script that copies image raster files selected through a defined polygon to another folder.&lt;/P&gt;
&lt;P&gt;It works quite well with few tiles, but with a larger amount I get the following message?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;"UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 4: ordinal not in range(128)"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;What does this mean?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is the error. But, does it provide you with the line number for where the crash occurs? Traceback.&lt;/P&gt;&lt;P&gt;We can see the character that is not capable of passing through. There may be more than this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 14:36:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560024#M43801</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-17T14:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560025#M43802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;line 85, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()&lt;/P&gt;&lt;P&gt;UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 4: ordinal not in range(128)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in line 85 is written:&lt;/P&gt;&lt;P&gt;print arcpy.GetMessages()&lt;/P&gt;&lt;P&gt;??? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 15:24:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560025#M43802</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-07-17T15:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560026#M43803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You maybe have solved your problem by now, but if not, here is a suggestion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are getting the error in the &lt;STRONG&gt;except&lt;/STRONG&gt; clause, maybe the root cause is really the problem, and you need to find out where the exception is actually being raised.&amp;nbsp; You could temporarily remove the &lt;STRONG&gt;try:&lt;/STRONG&gt; and &lt;STRONG&gt;except:&lt;/STRONG&gt; to expose where the exception is really occurring.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 05:24:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560026#M43803</guid>
      <dc:creator>ElleryChan</dc:creator>
      <dc:date>2014-08-04T05:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting files with python</title>
      <link>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560027#M43804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all and Ellery, that was the right answer.&lt;/P&gt;&lt;P&gt;The problem was print row.Pfad ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 06:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-exporting-files-with-python/m-p/560027#M43804</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-08-04T06:25:00Z</dc:date>
    </item>
  </channel>
</rss>

