Call to wxWidgets function before wxApp created (../src/common/stdpbase.cpp(62): assert "traits" failed in Get(): create wxApp before calling this)
Description
When running a headless python script using the pcbnew python interface you get a warning:
./src/common/stdpbase.cpp(59): assert ""traits"" failed in Get(): create wxApp before calling this
I think this is due to the change in 719be616 which reverts the previous fix e8369c94 of the same issue #5748 (closed).
Steps to reproduce
- Run the following python script:
import pcbnew
pcbnew.CreateEmptyBoard()
- You get the error message:
./src/common/stdpbase.cpp(59): assert ""traits"" failed in Get(): create wxApp before calling this
KiCad Version
Application: KiCad x86_64 on x86_64
Version: (7.0.0-37-g5c45b53f88), release build
Libraries:
wxWidgets 3.2.1
FreeType 2.12.1
HarfBuzz 5.3.1
FontConfig 2.14.0
libcurl/7.86.0 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.47.0
Platform: macOS Ventura Version 13.2 (Build 22D49), 64 bit, Little endian, wxMac
Build Info:
Date: Feb 12 2023 02:04:05
wxWidgets: 3.2.1 (wchar_t,wx containers)
Boost: 1.80.0
OCC: 7.6.3
Curl: 7.77.0
ngspice: 38
Compiler: Clang 13.0.0 with C++ ABI 1002
Build settings:
KICAD_SPICE=ON