Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the AioClient has an exceptiion with call range() function #114

Closed
boylegu opened this issue Nov 7, 2019 · 2 comments · Fixed by #115
Closed

the AioClient has an exceptiion with call range() function #114

boylegu opened this issue Nov 7, 2019 · 2 comments · Fixed by #115
Labels
bug Something isn't working

Comments

@boylegu
Copy link

boylegu commented Nov 7, 2019

  • etcd3-py version: 0.1.6
  • Python version: 3.6.8
  • Operating System: osx 10.13.6

Description

the AioClient has an exceptiion with call range() function
As follows:

What I Did

import asyncio
from etcd3 import AioClient

client = AioClient()

async def AsyncFunc():
    r = await client.range('foo')
    print('key:', r.kvs[0].key, 'value:', r.kvs[0].value)

loop = asyncio.get_event_loop()
loop.run_until_complete(AsyncFunc())

==============================

Traceback (most recent call last):
  File "/xxxxxx/srv/etcddemo.py", line 4, in <module>
    Aclient = AioClient()
  File "/Users/pyvers/py3.6.8_health_env/lib/python3.6/site-packages/etcd3_py-0.1.6-py3.6.egg/etcd3/aio_client.py", line 177, in __init__
    connector = aiohttp.TCPConnector(limit=pool_size, ssl=self.ssl_context)
  File "/Users/pyvers/py3.6.8_health_env/lib/python3.6/site-packages/aiohttp-4.0.0a1-py3.6-macosx-10.13-x86_64.egg/aiohttp/connector.py", line 711, in __init__
    enable_cleanup_closed=enable_cleanup_closed)
  File "/Users/pyvers/py3.6.8_health_env/lib/python3.6/site-packages/aiohttp-4.0.0a1-py3.6-macosx-10.13-x86_64.egg/aiohttp/connector.py", line 207, in __init__
    loop = get_running_loop()
  File "/Users/pyvers/py3.6.8_health_env/lib/python3.6/site-packages/aiohttp-4.0.0a1-py3.6-macosx-10.13-x86_64.egg/aiohttp/helpers.py", line 276, in get_running_loop
    raise RuntimeError("The object should be created from async function")
RuntimeError: The object should be created from async function

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.90. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug Something isn't working label Nov 7, 2019
@Revolution1
Copy link
Owner

It seems to be a breaking change of aiohttp

aio-libs/aiohttp#3331

I'll try to fix it.

Don't know why you are using the 'alpha1' version of aiohttp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants