-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in kibom.component.Component, self.libpart is None #147
Comments
Note that the line 191 in the code you quote can't raise this exception. |
good catch @set-soft, i think i used the pypi installation. let me try installing from the repo. |
so i was able to more-or-less fix it, thanks @set-soft . There was a misplaced parenthesis on line 199 that I had to fix as well before I could get it to run and raise the AttributeError properly (see #148). After fixing that and getting it to run, I had a question. Is there a reason we cannot return
Which is what I am assuming is causing this error to be raised. So I'm wondering what the rationale is for raising an Lines 193 to 200 in 0ce83c2
|
@hkennyv Assuming the |
I was getting the same error:
I was able to resolve this error by manually adjusting the <libsource lib="" part="Device:R_Small_11" description="Resistor, small symbol"/> This should be: <libsource lib="Device" part="R_Small_11" description="Resistor, small symbol"/> After the change, I no longer get the error. This snippet of regex might help those in need as there were a lot of mistakes in my file: :%s/lib=""\ part="\(.*\):\(.*\)"/lib="\1"\ part="\2"/g I'm running on nightly so this might just be one of the latest bugs but I thought I should mention it should anyone run into it as well! |
Hi @gbalke ! |
You're correct, it was the older version on PyPi. It was interesting to see KiCad generating these sorts of xmls though 🤔 Apologies for the slow response and thank you for the speedy reply! |
Hi @gbalke ! |
I ran into this error:
i tried to trace it down and i found that in the constructor,
self.libpart
is initialized toNone
:KiBoM/kibom/component.py
Lines 46 to 48 in 0ce83c2
This is particularly problematic because there are multiple places in this file that call some method on
self.libpart
, which is guaranteed to throw an AttributeError.Particularly, the one I ran into is this path that gets executed and there's not guard for checking if
self.libpart is None
:KiBoM/kibom/component.py
Lines 186 to 200 in 0ce83c2
A quick search for
self.libpart
shows that not all method calls have a guard to check ifself.libpart
is not NoneIt looks like
Component.setLibPart
gets called in netlist_reader.py, but for some reason,self.libpart
was still None in my example. It seems like the solution is to ensure that there is a guard every time that a method onself.libpart
is calledThe text was updated successfully, but these errors were encountered: