ExtractByMask Error

Discussion created by chewentao on Apr 18, 2010
Latest reply on Oct 12, 2017 by richeymrr

ExtractByMask does not work for the following Python:

import arcpy
tif = "H:\\Test-20100419\\t.tif"
shp = "H:\\Test-20100419\\A27401_05.shp"
out_raster = "H:\\Test-20100419\\ttt.tif"
out =, shp)

Error message:

Traceback (most recent call last):
  File "H:\Test-20100419\", line 6, in <module>
    out =, shp)
  File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\", line 1210, in ExtractByMask
  File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\", line 67, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\", line 1204, in wrapper
  File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\geoprocessing\", line 438, in <lambda>
    return lambda *args: val(*gp_fixargs(args))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000879: Output raster: The length of the stack base name in H:\Test-20100419\Extract_t1 is longer than 9.
Failed to execute (ExtractByMask).

I set the output raster as a TIF not a Grid Stack, I can not understand the error message "The length of the stack base name is longer than 9." This is not the case.

There is no any problem when I use ExtractByMask Tool in ArcToolbox.

Best regards,


KKC, Tokyo, Japan