Hi,
I have a workspace that executes a piece of python in a PythonCaller which uses ArcPy. However it crashes the ArcGIS application that is running the ArcPy(Not FME Form), giving the following popup
The log doesn't have any errors and only two warnings:
Python: There is a known Windows bug that may cause instability when using Python in the current locale. Please update to Windows 10 version 2004 and greater, or to Windows Server 2022. See http://fme.ly/nw5 for more details
I have seen this warning a few times and in articles. So far this is the first time it gives me a crash. Articles say you need to update your windows version. At the moment I have Windows Server 2019 Datacenter, Version 1809.
So there is an update possible here.
Another warning is: PythonFactory script changed the current FME process locale from 'Dutch_Netherlands.utf8' to 'Dutch_Netherlands.1252' and FME has restored it back to 'Dutch_Netherlands.utf8'. It is undefined behavior to change locale and doing so may cause unexpected errors. For more information, visit http://fme.ly/PythonLocaleError
According to the following issue:
This should be solved in FME Form 2024.1. However I am using FME Form 2024.1 build 24612 and still recieve this warning and am unaware of any solutions for this problem.
This is Python code that is executed with the PyCaller. It Should list all feature classes and tables in an enviroment and then delete them:
import fme
import fmeobjects
import arcpy
class FeatureProcessor(object):
def __init__(self):
pass
def input(self,feature):
arcpy.env.workspace = "Path/to/the/workspace"
try:
featureclasses = arcpy.ListFeatureClasses()
for fc in featureclasses:
arcpy.Delete_management(fc)
print("Deleted {0}".format (fc))
except Exception as e:
print (e)
try:
tables = arcpy.ListTables()
for table in tables:
arcpy.Delete_management(table)
print("Deleted {0}".format(table))
except Exception as e:
print (e)
self.pyoutput(feature)
def close(self):
pass
All Transformers and Readers/Writers are updated to their newest versions.
Any advice or solution to the problem is very welcome. If any more information is need, I'll try to help you.
Thanks in advance,
Sander