pylessard / python-udsoncan

Python implementation of UDS (ISO-14229) standard.
MIT License
564 stars 195 forks source link

Fix Unbound Local Error #197

Closed awiegel closed 6 months ago

awiegel commented 6 months ago

In the method send_request when receive payload is None the variable timeout_name_to_report is not set and causes the error.

[UnboundLocalError] : cannot access local variable 'timeout_name_to_report' where it is not associated with a value
-> ...\udsoncan\client.py:2185

pylessard commented 6 months ago

What Connection object makes a timeout without raising a Timeout exception?

awiegel commented 6 months ago

udsoncan.connections.PythonIsoTpConnection (on Windows).

What I do is sending a repeated request during startup (turning ECU on and initializing drivers).

pylessard commented 6 months ago

You are right. There's a discrepency between how connections behaves.

Thank you for this, but I will implement a fix a little different from this one.

pylessard commented 6 months ago

Handled by #198

pylessard commented 6 months ago

Fixed v1.21.1