Closed wlockwood closed 9 months ago
It could be a regression, but in your manual example you forgot to call close()
I thought I'd confirmed this sufficiently, but the close()
that was never awaited was the first, orphaned client - I had it in because I copied it from an example, but didn't notice that I was creating a client then immediately overwriting that client variable.
to be honest you are not the only one, I thought there was a problem in the library, but looking at your code again, I can see it.
Let us hear if you stumble on other problem
Versions
Pymodbus Specific
Async client
Description
(May be a regression bug related to #1365) The context managed implementation for
AsyncModbusTcpClient
doesn't awaitclose()
.I tested this with the example code from the ReadTheDocs and a context-managed clone of the same.
Code and Logs
Context managed
Results in:
Manual
Opening and closing the client manually works and doesn't encounter any exceptions: