laptop and a wrench

Bug

ListRasters function syntax returns nothing in Python 2.4, but works as expected in Python 2.1.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM035241
SubmittedMay 14, 2008
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.2
StatusNon-Reproducible

Additional Information

No Public Explanation

Workaround

Changing gp.ListRasters("*", "TIFF") to gp.ListRasters("*", "TIF") seems to have fixed the problem in some cases. Here is the code that seems to works every time in Python 2.4 :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#import win32com.client, sys, string, os#gp = win32com.client.Dispatch("esriGeoprocessing.GPDispatch.1")import arcgisscripting, sysgp = arcgisscripting.create()gp.setproduct("arcinfo")gp.workspace = r"<a href="file:C:/TEMP" target="_blank">C:\TEMP</a>"# Get a list of grids in the workspace.rasters = gp.ListRasters("*", "TIF")raster = rasters.next()while raster: print raster raster = rasters.next()del gp~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Steps to Reproduce

Bug ID: NIM035241

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options