mvn23 / pyotgw

A library to interface with the OpenTherm Gateway through serial or network connection.
GNU General Public License v3.0
27 stars 16 forks source link

DeprecationWarnings in log with python>=3.8 #29

Closed andriej closed 3 years ago

andriej commented 3 years ago

While browsing local log files on HA with OTGW integration, I've encountered this deprecation warning spam in log:

defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)

it's repeating itself and making disk-writes going above any reasonable amount :)

mvn23 commented 3 years ago

Thanks for the report, this will be fixed in the next version after firmware 5.0 support and some other things are done. The only thing I don't understand is why I'm not seeing this anywhere on my setup :confused:

EDIT: for now you could work around it by removing the , loop=self.loop part from the mentioned line (untested, but should work).

andriej commented 3 years ago

On Debian 10 it's in /var/log/messages by default. Thanks for the fix, will implement later on :)

mvn23 commented 3 years ago

Did some digging, turns out they are usually only shown when python is running in dev mode, which is not the case on my production environment.

andriej commented 3 years ago

Neither is mine - it's standard Supervised installation :-)

tirkarthi commented 3 years ago

The loop parameter was removed in Python 3.10 : https://bugs.python.org/issue42392