When I am running a script (it checks to which database a mxd is connected) I get the following error:
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2265' in position##: character maps to <undefined>
Script:
import os, arcpy
directory = r"C:\Project"
for root, dirs, files in os.walk(directory):
for myFile in files:
fileExt = os.path.splitext(myFile)[1]
if (fileExt == ".mxd"):
fullPath = os.path.join(root, myFile)
print myFile
myMap = arcpy.mapping.MapDocument(fullPath)
layers = arcpy.mapping.ListLayers(myMap)
for layer in layers:
wsPath = ""
try:
wsPath = layer.workspacePath
except:
pass
if wsPath:
print " " + layer.name + " : " + wsPath
Is there a way to keep the script running and catch an exception?