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
We encountered the following KeyError while running latest version, 2.0.12:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/site-packages/j1939/electronic_control_unit.py", line 282, in _async_job_thread
next_wakeup = self.j1939_dll.async_job_thread(now)
File "/usr/local/lib/python3.10/site-packages/j1939/j1939_21.py", line 162, in async_job_thread
buf = self._rcv_buffer[bufid]
KeyError: 33023
Here is the code snippet:
# check receive buffers for timeout
# using "list(x)" to prevent "RuntimeError: dictionary changed size during iteration"
for bufid in list(self._rcv_buffer):
buf = self._rcv_buffer[bufid]
My guess is that try catch block should wrap "buf = self._rcv_buffer[bufid]" to catch the key error.
I assume a different thread has deleted that particular bufid inbetween the "for in" statement and the dictionary lookup.
Thoughts?
The text was updated successfully, but these errors were encountered:
We encountered the following KeyError while running latest version, 2.0.12:
Here is the code snippet:
My guess is that try catch block should wrap "buf = self._rcv_buffer[bufid]" to catch the key error.
I assume a different thread has deleted that particular bufid inbetween the "for in" statement and the dictionary lookup.
Thoughts?
The text was updated successfully, but these errors were encountered: