pymodbus-dev / pymodbus

A full modbus protocol written in python
Other
2.29k stars 938 forks source link

Fix ModbusSerialServer super().__init__ Parameter Order #1870

Closed chandlerwr closed 1 year ago

chandlerwr commented 1 year ago

In the constructor for ModbusSerialServer, the call to super().__init__ flipped the "request_tracer" and "response_manipulator" parameters. Passing a request_tracer as normal resulted in a "cannot unpack non-iterable NoneType object" error when a request was recieved.

To reproduce the same bug, replace the TCP server with a serial server in the server_hook.py example.

Fixed by reversing the two parameters in the function call. Also added labels to try and prevent further ordering issues if parameters are changed in the future.