PCBnew spyder3 freezes with qt5ct
Description
I am running a Python script from Spyder3 that uses pcbnew module to create a PCB. It works fine the first time I run it and the PCB file is created. The second (or sometimes the third) time I run it, Spyder3 freezes with the following error message:
An error ocurred while starting the kernel
qt5ct: using qt5ct plugin
And the only step to quit it is to restart the interpreter console (kernel).
Steps to reproduce
- Open Spyder3
- Press F5 to run the script
- Press F5 to run the script again.
- Press F5 to run the script again.
Here a minimal script example:
import pcbnew
b = pcbnew.BOARD()
z = b.Zones()
ze = pcbnew.ZONE_CONTAINER(b)
z.append(ze)
b.Save("/tmp/board.kicad_pcb")
KiCad Version
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
IPython 5.5.0 -- An enhanced Interactive Python.
Application: KiCad
Version: 5.1.5-52549c5~86~ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-72-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.5.0 with C++ ABI 1011
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON