You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib=ffi.dlopen("c") # workaround if we're only building docs
If the dlopen fails, the original error is lost and that makes debugging very annoying. As you can see in this traceback, the error didn't happen on import and the message gives no indication about why it failed:
Traceback (most recent call last):
File "examples/line_echo.py", line 26, in <module>
anyio.run(main, backend="trio")
File "/home/pi/ve/lib/python3.7/site-packages/anyio/_core/_eventloop.py", line 56, in runreturn asynclib.run(func, *args, **backend_options) # type:ignore
File "/home/pi/ve/lib/python3.7/site-packages/trio/_core/_run.py", line 1932, in runraise runner.main_task_outcome.error
File "examples/line_echo.py", line 18, in mainwith gpio.Chip(0) as c:
File "/home/pi/ve/lib/python3.7/site-packages/asyncgpio/gpio.py", line 39, in __enter__self._chip = gpio.lib.gpiod_chip_open_by_number(self._num)
File "/home/pi/ve/lib/python3.7/site-packages/cffi/api.py", line 912, in __getattr__
make_accessor(name)
File "/home/pi/ve/lib/python3.7/site-packages/cffi/api.py", line 908, in make_accessor
accessors[name](name)
File "/home/pi/ve/lib/python3.7/site-packages/cffi/api.py", line 838, in accessor_function
value = backendlib.load_function(BType, name)
AttributeError: function/symbol 'gpiod_chip_open_by_number' not found in library 'libc.so.6': /lib/arm-linux-gnueabihf/libc.so.6: undefined symbol: gpiod_chip_open_by_number
If this is really just a workaround for docs, maybe better to include e.g. if not os.environ.get('_ASYNCGPIO_BUILDING_DOCS'): raise in the except stanza?
The text was updated successfully, but these errors were encountered:
asyncgpio/asyncgpio/libgpiod.py
Lines 318 to 321 in ebde1ab
If the
dlopen
fails, the original error is lost and that makes debugging very annoying. As you can see in this traceback, the error didn't happen on import and the message gives no indication about why it failed:If this is really just a workaround for docs, maybe better to include e.g.
if not os.environ.get('_ASYNCGPIO_BUILDING_DOCS'): raise
in the except stanza?The text was updated successfully, but these errors were encountered: