Just a quick comment: the KiCad python interpreter still uses python2.
This means that the script is imported to KiCad’s python console, it will crash when opening files for write (because of open(..., newline=''). Removing the newline part seems to do the trick.
Not anymore it does not !
If your distro-provided build is still using Py2, please ask the maintainers to add the CMake build flag KICAD_SCRIPTING_PYTHON3=ON.
About the Py2 compatibility, removing newline may create an odd (but correct) CSV file. According to the internet, you can use :
OK, let me rephrase that: the nightly version for my OS (macOS) uses python2. I wasn’t aware of different versions of python in different versions of kicad. My bad.
@Rene_Poschl, do you know if it also applies for macOS?
I was a bit trolly in this message I know some platforms are not fully py2 compatible, as the py3 port is very new. (To be honest I didn’t even think about MacOS)
Was newline the only change required for python 2 ?