[solved] Help needed with StepUp error "Trouble with nesting of brackets"


The following Error is issued if I try to load the file “goboard-main.kicad_pcb” with the StepUp workbench in FreeCAD:

10:40:17  opening /home/bernd/Dokumente/Projekte/Tastatur/goboard/hardware/main/goboard-main.kicad_pcb
10:40:17  my file path /home/bernd/Dokumente/Projekte/Tastatur/goboard/hardware/main
10:40:17  py3
10:40:17  Running the Python command 'ksuToolsOpenBoard' failed:
Traceback (most recent call last):
  File "/home/bernd/.FreeCAD/Mod/kicadStepUpMod/kicadStepUpCMD.py", line 656, in Activated
  File "/home/bernd/.FreeCAD/Mod/kicadStepUpMod/kicadStepUptools.py", line 7744, in onLoadBoard
    mypcb = KicadPCB.load(name) #test parser
  File "/home/bernd/.FreeCAD/Mod/kicadStepUpMod/kicadStepUptools.py", line 1673, in load
    return KicadPCB(parseSexp(f.read().decode('utf8').replace(u'\\"',u'_'))) # maui replacing  \" with _ to avoid wrong parsing  test py3
  File "/home/bernd/.FreeCAD/Mod/kicadStepUpMod/kicadStepUptools.py", line 1530, in parseSexp
    assert stack, "Trouble with nesting of brackets"

Trouble with nesting of brackets

The project can be found here: https://github.com/BerndGottschlag/goboard
The issue is present in all commits I tested. The newest commit at the time of writing is a253129a.

A few things to note:

  • KiCad does not show any errors when opening the PCB and I can see the PCB in the 3D viewer.
  • The PCB is currently a work-in-progress. Many footprint assignments and traces are still missing.
  • Only the main board (hardware/main) has this problem, the numpad (hardware/numpad) can be loaded in FreeCAD.
  • The only 3D-model I added (the USB-C jack) does not seem to be the cause of the problem. When I add it to the numpad the problem does not occur.
  • If I remove all footprints from the PCB that are not from the standard library and not present on the numpad the problem still occurs.

This topic is linked to my problem:

Is there any way I can further troubleshoot the problem (e.g. logfiles)?
Do you have an Idea how to fix this?
Any help is appreciated!

Version Information:

Version: 5.99.0-unknown-r25169-00a99101, debug build

OS: Fedora 33 (Workstation Edition) (GNOME/gnome-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.Unknown
Build type: Unknown
Python version: 3.9.0
Qt version: 5.15.1
Coin version: 4.0.0a
OCC version: 7.5.0
Locale: German/Germany (de_DE)

sudo dnf info freecad gives the following info:
Release : 0.3.20201125gita50ae33557.fc33.2
Source : freecad-0.19-0.3.20201125gita50ae33557.fc33.2.src.rpm

Operating System:
Name: Fedora 33 (Workstation Edition)
GNOME-Version: 3.38.2
Display manager: X11

I think the problem might be the “\\” at line https://github.com/BerndGottschlag/goboard/blob/a253129ae29e5d1d3e44a0030605d6e758e9172a/hardware/main/goboard-main.kicad_pcb#L4878

To confirm that, try changing it to "x" and re-importing.

1 Like

That was it.
Thank you very much! :smiley: