We need to set the format earlier and handle internal filenames Fixes https://gitlab.com/kicad/code/kicad/issues/20161 (cherry picked from commit 89b92fe3f5)
89b92fe3f5