I have a very simple script that I'm testing. It has always been working so far, but now I'm running in an unexpected error. When I try to save my files in a folder different than the environment one, it outputs this error:
outSnowmask.save (newpath_01+ '\\'+ 'snow_'+ MODIS)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 47: ordinal not in range(128)
My code is:
import arcpy, os, sys, shutil
newpath_01= r'C:\\Users\\unimi\\Documents\\Umberto\\Università\\PhD\\Karakoram\\MODIS_Pakistan\\Aspect\\temporary_01'
if not os.path.exists (newpath_01):
os.makedirs (newpath_01)
arcpy.env.workspace = 'C:\\Users\\unimi\\Documents\\Umberto\\Università\\PhD\\Karakoram\\MODIS_Pakistan\\MODIS_Clip\\Sample_test'
arcpy.env.overwriteOutput= True
from arcpy.sa import *
listMODIS = arcpy.ListRasters ()
print listMODIS
arcpy.CheckOutExtension ('Spatial')
for MODIS in listMODIS:
outSnowmask = ExtractByAttributes(MODIS, "VALUE = 200")
outSnowmask.save (newpath_01+ '\\'+ 'snow_'+ MODIS)