pythonocc-core
pythonocc-core copied to clipboard
OSD::SetSignal() for Exception handling in Python
Hi I am using pythonocc to read a step file thanks to the read_step_file function of the OCC.Extend.DataExchange module. In case of a corrupted file (e.g. missing references) the above function generates a crash in python without generating exceptions. I have already tried using a try-except statement without results.
I have read in the C++ documentation about the OSD::SetSignal() function (joined with OCC_CATCH_SIGNALS in linux) which is supposed to turn application kill signals into exceptions.
Searching the python library I have not found how to enable this feature and the program keeps crashing without exception. Does anyone know if these options are available?
pythonocc should catch all occt exceptions and raise a proper python exception. Thus, if python does not raise any exception, it is because of occt itself, and you should get a segfault. Can you please post a code snippet and the buggy step file?