pcbnew: plotting fails if more than one level of folders at target location doesn't exist
Description
Generating gerber files fails when it would need to create more than one level of folders at the target location.
Steps to reproduce
- do a checkout of the project where I was encountering the issue: https://github.com/felixheld/qspimux
- open qspimux2/qspimux2.kicad_pcb in pcbnew
- open plot window and click plot without changing anything else. if it asks to redraw polygons, let it do that.
- expectation: gerber files get generated. current behavior: warning dialog box "Could not write plot files to folder [...]". click ok. warning dialog box "Directory [...] couldn't be created [...]"
- create folder named gerber inside the root of the project directory, try step 3 again; now it only needs to create one layer of new folders which works
KiCad Version
Application: KiCad
Version: (5.99.0-6733-ga0060086b0), release build
Libraries:
wxWidgets 3.0.5
libcurl/7.71.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0
Platform: Windows 10 (build 18363), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Oct 31 2020 22:11:28
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.73.0
OCE: 6.9.1
Curl: 7.71.0
ngspice: 32
Compiler: GCC 10.2.0 with C++ ABI 1014
Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON
The issue was already present in the nightly builds maybe a year ago.