Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade

$
0
0
Since upgrading to 10.2 the script I ran weekly for ArcSDE maintenance fails with an "Invalid floating point operation" error during the loop shown below:

Code:

# Get a list of all the datasets.
# First, get all the stand alone tables, feature classes and rasters.
dataList = arcpy.ListFeatureClasses() + arcpy.ListRasters()

# Next, for feature datasets get all of the featureclasses
# from the list and add them to the master list.
for dataset in arcpy.ListDatasets():
    print "Adding:", arcpy.ListFeatureClasses(feature_dataset=dataset)
    dataList += arcpy.ListFeatureClasses(feature_dataset=dataset)
# Execute the ReconcileVersions tool.
arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",verList,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")

I had inserted the print statement only for debugging purposes, and when I ran the script, the last few lines output by the statement were:

Adding: [u'bc.GIS_ADMIN.landuse_zoning']
Adding: [u'bc.GIS_ADMIN.dimensions', u'bc.GIS_ADMIN.dimension_2']
Adding: [u'bc.GIS_ADMIN.traffic_lights', u'bc.GIS_ADMIN.valves', u'bc.GIS_ADMIN.StormStructures', u'bc.GIS_ADMIN.signs', u'bc.GIS_ADMIN.sidewalks', u'bc.GIS_ADMIN.manholes', u'bc.GIS_ADMIN.light_standard', u'bc.GIS_ADMIN.hydro_pole', u'bc.GIS_ADMIN.hydrants', u'bc.GIS_ADMIN.decorative_light_standard', u'bc.GIS_ADMIN.curb_gutter', u'bc.GIS_ADMIN.culverts', u'bc.GIS_ADMIN.bridge']
Adding: []
Adding: []
Adding:

I'm puzzled as to why the loop prints two empty strings ([]) followed by nothing, just before raising the floating point error. All feature classes within feature datasets are successfully listed ahead of these empty ones in the print output. I suspect these blank lines might be the cause of the error, but I see lots of "Unknown function at" lines in the error details. I can't tell whether the ReconcileVersions is ever actually reached.

Is there something I need to do to make this work, or in other words, enable 10.1 python code to run at 10.2?

Thanks,
Justin

Viewing all articles
Browse latest Browse all 2485

Trending Articles