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
When I was trying to start a simulator by running main.py in server/simulator/, python complained with error logs below:
pymodbus $ PYTHONPATH=. python server/simulator/main.py
2023-07-18 09:23:23,159 INFO logging:96 Start simulator
Executing <Task finished name='Task-1' coro=<run_main() done, defined at /Users/hydra/Documents/coding/pymodbus/pymodbus/server/simulator/main.py:112> exception=TypeError("__init__() got an unexpected keyword argument 'loop'") created at /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:621> took 0.118 seconds
Traceback (most recent call last):
File "xxx/pymodbus/server/simulator/main.py", line 125, in<module>main()
File "xxx/pymodbus/server/simulator/main.py", line 121, in main
asyncio.run(run_main(), debug=True)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
returnfuture.result()
File "xxx/pymodbus/server/simulator/main.py", line 115, in run_main
task = ModbusSimulatorServer(**cmd_args)
File "xxx/pymodbus/server/simulator/http_server.py", line 168, in __init__
self.modbus_server = comm(framer=framer, context=datastore, **server)
TypeError: __init__() got an unexpected keyword argument 'loop'
I've digged into the commit logs of pymodbus and found that class ModbusTcpServer in pymodbus/server/async_io.py was originally accepting a **kwargs value in init which is removed in current dev branch. If I'm right I think **kwargs should be added back, or the "loop" args in http_server.py L152 server["loop"] = asyncio.get_running_loop() should be removed.
The text was updated successfully, but these errors were encountered:
fhydralisk
added a commit
to fhydralisk/pymodbus
that referenced
this issue
Jul 18, 2023
Versions
Pymodbus Specific
Description
When I was trying to start a simulator by running main.py in server/simulator/, python complained with error logs below:
I've digged into the commit logs of pymodbus and found that class ModbusTcpServer in pymodbus/server/async_io.py was originally accepting a **kwargs value in init which is removed in current dev branch. If I'm right I think **kwargs should be added back, or the "loop" args in http_server.py L152
server["loop"] = asyncio.get_running_loop()
should be removed.The text was updated successfully, but these errors were encountered: