0

I'm using Python 2.7.8 and ArcGIS Desktop 10.3.1 to automate some of the ArcGIS workflows with Python scripts. My code started crushing with no error message as follows:

Python crush message

The main issue was that there was no indication on the line, where it crushed or on the reason.

1

I have worked out (with manual debugging with print statements) that the problem was with the following code part:

    name_cluster_head = '{0}_{1}'.format(i, output_name)
    out_cluster_head = os.path.join(output_fds, name_cluster_head)
    arcpy.CopyFeatures_management(facilities_sublayer, out_cluster_head)

More specifically with arcpy.CopyFeatures_management. I have not really found any related issues online, so I have tried to avoid the function with:

    arcpy.FeatureClassToFeatureClass_conversion(facilities_sublayer, output_fds, name_cluster_head) 

This resulted in the following error message:

arcpy Feature to feature naming error message

So it became clear that the problem was in the naming. The name starts with the number and it somehow creates the problem with arcpy. After changing to:

    name_cluster_head = 'Cluster_head_{0}_{1}'.format(i, output_name)

The issue was solved.

  • 1
    Using valid identifiers is of course required, but failure to do so shouldn't crash Python. If you can reproduce this with a modern ArcGIS build, then I would urge you to contact Tech Support. – Vince Jul 17 '18 at 11:17
  • @Vince, my point exactly. It should have worked as with arcpy.FeatureClassToFeatureClass_conversion . I will think about further testing it, but at the moment I use only 10.3.1, so reported my problem. When I have some time to install a newer version I will test it. – elena_grigoreva Jul 17 '18 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.