Closed MatteoTondelli closed 2 years ago
This is not a bug in KiCad, but rather a limitation in kiutils. So far i am only doing end-to-end tests for parsing directly from and to files. Adding stuff to schematics or other things or building them from scratch is something i have yet to test.
Your fix should be the best solution for this problem, but let me create some test cases first :-)
Starting from an existing schematic I tried to add a new property with the following script:
The script runs smoothly, but when I try to open the
.kicad_sch
file I got the following error from KiCAD:This is the line inside the file that generates the error:
If I change it like this:
KiCAD is able to load the schematic correctly.
The error is due to the default
None
value of[ANGLE]
parameter inkiutils.items.common.Position
class, however I think KiCAD documentation is not too clear on this topic because the angle attribute should be optional.Maybe it can be considered a KiCAD bug, but a quick and dirty fix to the
kiutils.items.common.Property
class definition could be as follow:Additional info: