AnsweredAssumed Answered

Anyone able to run arcpy.ListFeatureClasses() successfully?

Question asked by ben_vk on Jun 8, 2017
Latest reply on Jun 13, 2017 by jhead@lakeworth

ANSWER: I was missing the 'feature_dataset=' from line 14 of my test code. Credit goes to Xander Bakker for the sample code that pointed this out




Hey All, 


I have ArcMap installed at version 10.3.1 and I have several automation scripts, and I have recently noticed all my scripts that use arcpy.ListFeatureClasses() fatally error out at that tool. 


Is someone else able to confirm they are able to run this without any critical errors?


I have just used the below code to test it bare basics, if someone else could please assist by changing the three variables to suit, does it run successfully?


import arcpy

connection = r"Database Connections\GISADMIN@SDE_Spatial@SDE-DB.sde"
arcpy.env.workspace = connection

test_dataset = r'Database Connections\GISADMIN@SDE_Spatial@SDE-DB.sde\SDE_SPATIAL.GISADMIN.Airport'

test_feature_within_dataset = r'Database Connections\GISADMIN@SDE_Spatial@SDE-DB.sde\SDE_SPATIAL.GISADMIN.Airport\SDE_SPATIAL.GISADMIN.Airport_Lighting_Zones'

print arcpy.Exists(test_dataset)
print arcpy.Exists(test_feature_within_dataset)

print 'It will fail at the next line of code'
print arcpy.ListFeatureClasses(test_dataset)

print '\n\nTEST COMPLETE'


Fatal error



I am considering updating my machine to the latest version, but before I take this step I am hoping someone can confirm it doesn't work at this version?


Thanks very much for your time.