Python wrapping not working with Python >= 3.4
Mantis Issue 1476, reported by gpasero, assigned to gpasero, created: 2017-11-06
The python wrapping compiled using python 3 generate a strange error. Once the application is created, there is an issue in the resolution of C/C++ function to call from python.
The problem has been reproduced on Ubuntu 14.04 with python 3.4 and on CentOS 7 with python 3.5.
1510156012 - gpaseroThe problem comes because of setattr and getattr redefinitions in Python class Application. Somehow, SWIG also uses these functions : setattr = lambda self, name, value: _swig_setattr(self, Application, name, value) getattr = lambda self, name: _swig_getattr(self, Application, name)
With the debugger, I have seen strange loops in the callstack ...
When I comment out our custom setattr and getattr, issue is solved.
1510234219 - gpaseroFix merged into develop and release-6.2 : https://git.orfeo-toolbox.org/otb.git/commit/c5e303bc85a5dbe5f6f841b60c9ea5a8662bfbc4
I added specific SWIG code into the setattr and getattr method that we override.