Closed luckydonald closed 10 months ago
But it's apparently not only the loop parameter:
self._streamreader, self._streamwriter = yield from asyncio.open_connection(
response = yield from asyncio.wait_for(
elif isinstance(val, collections.Callable):
Bump, running into this now.
Also... asyncio_net/net_asyncio.py, asyncio.get_event_loop is being deprecated as well. Should be using asyncio.get_running_loop per https://docs.python.org/3/library/asyncio-eventloop.html
Umm. Not sure if the library is still alive. But in any case, here's what I get when trying to use it with asyncio on python 3.11:
In [1]: from rethinkdb import r
In [2]: r.set_loop_type('asyncio')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 r.set_loop_type('asyncio')
File ~/miniforge3/envs/py311/lib/python3.11/site-packages/rethinkdb/__init__.py:65, in RethinkDB.set_loop_type(self, library)
63 def set_loop_type(self, library=None):
64 if library == "asyncio":
---> 65 from rethinkdb.asyncio_net import net_asyncio
66 self.connection_type = net_asyncio.Connection
68 if library == "gevent":
File ~/miniforge3/envs/py311/lib/python3.11/site-packages/rethinkdb/asyncio_net/net_asyncio.py:42
38 pResponse = ql2_pb2.Response.ResponseType
39 pQuery = ql2_pb2.Query.QueryType
---> 42 @asyncio.coroutine
43 def _read_until(streamreader, delimiter):
44 """Naive implementation of reading until a delimiter"""
45 buffer = bytearray()
AttributeError: module 'asyncio' has no attribute 'coroutine'
We now have #294 for the Python 3.11 issue.
But there are a bunch of other PRs open that might carry the change -- I guess they should be looked at first.
@antony66 the library is still alive....kinda. We're quite busy and find little time to work on the project that has been abandoned for a long time. Furthermore, the changes in the python ecosystem are happening quite fast.
We're working on supporting python 3.10+ and drop support for python 2.XX . See the branch https://github.com/rethinkdb/rethinkdb-python/tree/lsabi/commands
To a basic implementation (asyncio
only) we're lacking the last checks here and there on the commands. The rest should be working. If you have knowledge and time enough, feel free to contribute on this branch
asyncio_net/net_asyncio.py, asyncio.get_event_loop is being deprecated as well. Should be using asyncio.get_running_loop per
Thanks for the info. Since get_running_loop is new in Python 3.7 and get_event_loop is not broken yet, I'm going to not update that just yet. (I'm trying to make the minimal set of PR's to get 3.10 and 3.11 more working right now.)
@lsabi let’s see if I can help
@lsabi I'm having this very issue. I would like to use this driver with python3.11 and onwards.
Is there anythingI can help with? Maybe implement some of the changes suggested in the PR.
@fdemian This is now already fixed in the master branch and you could build and use the driver off that yourself. I also created #301 to nag the devs into cutting a new release with these fixes.
Closing as this has now been fixed with the latest release https://github.com/rethinkdb/rethinkdb-python/releases/tag/v2.4.10
Describe the bug The most basic example fails
BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'
To Reproduce Steps to reproduce the behavior:
try to run the async example
Expected behavior It works.
Screenshots
System info
3.10.0
rethinkdb==2.4.8
Additional context Add any other context about the problem here.