aiocometd
aiocometd copied to clipboard
TypeError: Semaphore.__init__() got an unexpected keyword argument 'loop' in transport/long_polling.py file
I am getting a type error when I run a python script. It gives me a type error with loops in semaphore, which was deprecated in the latest python releases.
Is there any alternatives for this issue?
I have tried to find a solution to this but couldn't find a fix anywhere so I had to do something about it myself.
This is caused because 3.11 gets rid of the loop argument.
Fix:
- Edit transports/long_polling.py line 25 :
self._http_semaphore = asyncio.Semaphore(2)
- Edit client.py line 481 line to this (same thing, remove the loop argument and leave the rest as is):
done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED)
I have tried to find a solution to this but couldn't find a fix anywhere so I had to do something about it myself.
This is caused because 3.11 gets rid of the loop argument.
Fix:
- Edit transports/long_polling.py line 25 :
self._http_semaphore = asyncio.Semaphore(2)
- Edit client.py line 481 line to this (same thing, remove the loop argument and leave the rest as is):
done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED)
Maintainer seems to not have anymore activity in maintaining the module, and indeed the quick fix is to remove the loop arguments from those files.
Did anybody fork and maintain this module separately that is published?
I have tried to find a solution to this but couldn't find a fix anywhere so I had to do something about it myself. This is caused because 3.11 gets rid of the loop argument. Fix:
- Edit transports/long_polling.py line 25 :
self._http_semaphore = asyncio.Semaphore(2)
- Edit client.py line 481 line to this (same thing, remove the loop argument and leave the rest as is):
done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED)
Maintainer seems to not have anymore activity in maintaining the module, and indeed the quick fix is to remove the loop arguments from those files.
Did anybody fork and maintain this module separately that is published?
It seems like yes: https://pypi.org/project/aiocometd-noloop/