Anyone tried Python 3.7?

Hi all,

When I built recently with python 3.7 (macos, homebrew python), the python shell in ParaView works, but pvpython crashes on startup with:

% ./bin/pvpython 
Fatal Python error: _Py_InitializeCore: main interpreter already initialized

Current thread 0x000000010c7ca5c0 (most recent call first):
zsh: abort      ./bin/pvpython

I see the dashboards test python 3.5 and 3.6, but this may be new behavior for 3.7:

https://bugs.python.org/issue33932

I haven’t tried it but hopefully it will be fixed in Python 3.7.1. As far as I know it is a known issue: https://bugs.python.org/issue33932

Yes, I saw that issue but half of the discussion seems to be about changing the behavior of Py_Initialize() permanently so that double-initialization is no longer allowed. If pvpython is double-initializing then it seems like we should not.

I’ve looked in VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx and it looks like we’re trying not to double-initialize, but in the debugger, _Py_InitializeCore is called twice, once from vtkPythonInterpreter::Initialize (when it calls Py_InitializeEx) and once from vtkPythonInterpreter::PyMain (when it calls Py_Main).

This pattern of calling Py_Initialize and then Py_Main appears mildly frowned-upon and the original issue above also links to these:

https://bugs.python.org/issue34008
https://bugs.python.org/issue34206

which we should track since there may be changes in 3.8 after the 3.7 regression is fixed.

Please file an issue in VTK CC’ing the usual Python folks to track this.

Done: vtk #17434

I was looking at Python 3.7 too, and then came looking to see if others had issues. Glad I am not the only one, Arch Linux bumped recently.