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

v2.14.2 has interop problem with netdev running with python 3.8 #658

Closed
zhangyudong12 opened this issue May 21, 2024 · 3 comments
Closed

Comments

@zhangyudong12
Copy link

it works fine before upgrade to v2.14.2 that failed with following log

File "connect_test.py", line 117, in ops_task
async with netdev.create(**router) as net_connect:
File "/home/ec2-user/netdev/lib/python3.8/site-packages/netdev/vendors/base.py", line 185, in aenter
await self.connect()
File "/home/ec2-user/netdev/lib/python3.8/site-packages/netdev/vendors/ios_like.py", line 75, in connect
await self._establish_connection()
File "/home/ec2-user/netdev/lib/python3.8/site-packages/netdev/vendors/base.py", line 218, in _establish_connection
self._conn = await asyncio.wait_for(fut, self._timeout)
File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for
return fut.result()
File "/usr/local/lib/python3.8/asyncio/tasks.py", line 695, in _wrap_awaitable
return (yield from awaitable.await())
File "/home/ec2-user/netdev/lib/python3.8/site-packages/asyncssh/connection.py", line 8264, in connect
new_options = cast(SSHClientConnectionOptions, await _run_in_executor(
TypeError: _run_in_executor() got multiple values for argument 'loop'

there was only one loop value
<_UnixSelectorEventLoop running=True closed=False debug=False>

@zhangyudong12 zhangyudong12 changed the title v2.14.2 has interop problem with netdev running with python 3.7 v2.14.2 has interop problem with netdev running with python 3.8 May 21, 2024
@ronf
Copy link
Owner

ronf commented May 22, 2024

Are you by any chance passing in an explicit keyword "loop" argument in your call to connect()? That isn't required, and will be filled in automatically by AsyncSSH (gotten by calling asyncio.get_event_loop()). It's not supporting to try and pass in loop yourself as a keyword argument.

@zhangyudong12
Copy link
Author

"Removing the 'loop' keyword parameter from the arguments dictionary as you suggested indeed was the solution I needed. Thanks to your quick answer, I could successfully call the <asyncssh.connect()> function without any errors.

@ronf
Copy link
Owner

ronf commented May 23, 2024

Glad to hear you got it working -- happy to help!

@ronf ronf closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants