While trying to run a script I've used in python 2.7 for some time, I encountered real issues with the field mappings when trying to run it using python 3. Python 2.7 seemed more forgiving in the format of a field mapping variable for use with FeatureClassToFeatureClass_conversion(). I was able to change the string representation in several ways, including using the string rather then loading it into a FieldMappings() object. I've attached 2 examples of how the string for field mapping had to be formatted very differently to work in either python 2.7 or 3. I'm really not sure if this might not be a bug in arcpy for python 3, but I do know that the string format for field mappings used with FeatureClassToFeatureClass in python 2.7 is way more forgiving then what it had to be for python 3.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.