jesdial

Can't access to the errors with GetMessages()

Discussion created by jesdial on Oct 25, 2012
Latest reply on Nov 1, 2012 by curtvprice
Greetings to all

I'm not getting access to the error messages with arcpy.GetMessages arcpy () and related functions. I'm really frustrated with this problem. For example, if I run on the Windows:

arcpy.GetCount_management ("c :/ temp/solapes2.shp")


(where there is not solapes2.shp shape at the location indicated)

I get the following error message:

<class'arcgisscripting.ExecuteError'> Runtime error: ERROR 000732: Input Rows: c :/ temp/solapes2.shp the dataset does not exist or does not support


But if I execute, for example:

import arcpy
try:
**** result = arcpy.GetCount_management ("c :/ temp/solapes2.shp")
except:
arcpy.GetMessageCount print ()
arcpy.GetMessages print (2)


I only get:

0



(that is, a zero from GetMessageCount and a blank line from getMessages (2).

Where is the problem? Am I wrong with the way errors are handled in the Python window? I tried several scripts that appear in the Help and their behavior is similar to that describe ....

Thanks in advance

Jesús de Diego
Pd. I'm using ArcGIS 10.0, sp5. in a Windows 7 64 bits OS.

Outcomes