/path/to/session.py:328: RuntimeWarning: coroutine 'Lock.acquire' was never awaited
self.updateLock.acquire()
... and can throw the following exception if it attempts to release the lock without having acquired it:
[1/13/2024, 2:20:09 PM] Error: Python exception: Lock is not acquired.
Expected behavior
Calling HiveSession.updateData succeeds without spurious warning or errors.
Additional contextI have a patch here which simply adds an unasync rule to convert the asyncio.Lock in session.py to threading.Lock instead. No other code is affected by this change. I can open a PR, if you think this is an appropriate solution?
Describe the bug When
pyhiveapi
is packaged viaunasync
, it removes theawait
from thisasyncio.Lock
acquisition inHiveSession.updateData
but otherwise leaves theasyncio.Lock
in place. As a result, callingupdateData
generates the following warning:... and can throw the following exception if it attempts to release the lock without having acquired it:
Expected behavior Calling
HiveSession.updateData
succeeds without spurious warning or errors.Additional context I have a patch here which simply adds an
unasync
rule to convert theasyncio.Lock
insession.py
tothreading.Lock
instead. No other code is affected by this change. I can open a PR, if you think this is an appropriate solution?