AssertionError in VerboseParser #16

Closed
opened 2020-01-22 14:03:38 +00:00 by frankenstein91 · 3 comments
frankenstein91 commented 2020-01-22 14:03:38 +00:00 (Migrated from gitlab.com)

If I want to use your nice tool (version 0.3.0 from pip) on my Tuxedo Notebook, I get an error.

I am still at the very beginning of programming and would like to know how I can fix this error.

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/PycharmProjects/system/venv/lib/python3.8/site-packages/pylspci/parsers/base.py", line 43, in run
    return self.parse(lspci(**lspci_kwargs))
   File "/PycharmProjects/system/venv/lib/python3.8/site-packages/pylspci/parsers/verbose.py", line 102, in parse
     return list(map(
  File "/PycharmProjects/system/venv/lib/python3.8/site-packages/pylspci/parsers/verbose.py", line 77, in _parse_device
    assert key in self._field_mapping, \
AssertionError: Unsupported key 'NUMANode'

I can actually see a NUMANode in lspci, at least with my SD card reader.

I have used this code:

def getPCI():
    lspci = VerboseParser()
    pciData = lspci.run()
    print(pciData)
If I want to use your nice tool (version 0.3.0 from pip) on my Tuxedo Notebook, I get an error. I am still at the very beginning of programming and would like to know how I can fix this error. ``` Traceback (most recent call last): File "<input>", line 1, in <module> File "/PycharmProjects/system/venv/lib/python3.8/site-packages/pylspci/parsers/base.py", line 43, in run return self.parse(lspci(**lspci_kwargs)) File "/PycharmProjects/system/venv/lib/python3.8/site-packages/pylspci/parsers/verbose.py", line 102, in parse return list(map( File "/PycharmProjects/system/venv/lib/python3.8/site-packages/pylspci/parsers/verbose.py", line 77, in _parse_device assert key in self._field_mapping, \ AssertionError: Unsupported key 'NUMANode' ``` I can actually see a NUMANode in lspci, at least with my SD card reader. I have used this code: ``` def getPCI(): lspci = VerboseParser() pciData = lspci.run() print(pciData) ```
Lucidiot commented 2020-01-22 18:38:34 +00:00 (Migrated from gitlab.com)

Thank you for reporting this!

I could not get the NUMANode field to appear anywhere on my own computers, but I found random lspci dumps online such as this one showing the field is an integer, so I added it to the Device class.

While testing on every single Linux box I have access to, I also found the PhySlot device, another optional integer. I also made changes to respect the lspci manpage, which states that:

New tags can be added in future versions, so you should silently ignore any tags you don't recognize.

Well, it is not really silent because I want this package to support every new field, so instead of causing AssertionError like it did for you, it will now show a UserWarning, asking users to report an issue like you just did.

I released version 0.3.1 with the aforementioned fixes; run pip install --upgrade pylspci and your error should be fixed.

Thank you for reporting this! I could not get the `NUMANode` field to appear anywhere on my own computers, but I found random lspci dumps online such as [this one](https://www.linux-hardware.org/index.php?probe=90e04774e4&log=lspci) showing the field is an integer, so I added it to the `Device` class. While testing on every single Linux box I have access to, I also found the `PhySlot` device, another optional integer. I also made changes to respect the `lspci` manpage, which states that: > New tags can be added in future versions, so you should silently ignore any tags you don't recognize. Well, it is not really silent because I want this package to support every new field, so instead of causing `AssertionError` like it did for you, it will now show a `UserWarning`, asking users to report an issue like you just did. I released version 0.3.1 with the aforementioned fixes; run `pip install --upgrade pylspci` and your error should be fixed.
Lucidiot commented 2020-01-22 18:38:35 +00:00 (Migrated from gitlab.com)

closed

closed
frankenstein91 commented 2020-01-23 06:32:30 +00:00 (Migrated from gitlab.com)

Thank you

it is working on my system

Thank you it is working on my system
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lucidiot/pylspci#16
No description provided.