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

TypeError in connection exception handling code in 1.16.0 #615

Closed
nchammas opened this issue Nov 7, 2015 · 3 comments
Closed

TypeError in connection exception handling code in 1.16.0 #615

nchammas opened this issue Nov 7, 2015 · 3 comments

Comments

@nchammas
Copy link

@nchammas nchammas commented Nov 7, 2015

I'm seeing this problem in 1.16.0 but not 1.15.4. I'm running Python 3.5.0 on OS X.

I'm trying to connect to a host as it comes up and am getting this failure:

Traceback (most recent call last):
  File "flintrock.py", line 714, in get_ssh_client
    timeout=3)
  File ".../venv/lib/python3.5/site-packages/paramiko/client.py", line 311, in connect
    raise NoValidConnectionsError(errors)
  File ".../venv/lib/python3.5/site-packages/paramiko/ssh_exception.py", line 166, in __init__
    body = ', '.join([x[0] for x in addrs[:-1]])
TypeError: 'dict_keys' object is not subscriptable

This error seems to refer to this line. Looking at the history of ssh_exception.py and client.py, I'm guessing this problem was introduced as part of this commit.

I'm willing to track this down and provide a patch if you can give me a pointer. Perhaps _families_and_addresses() is not behaving as expected?

@edk0
Copy link

@edk0 edk0 commented Nov 7, 2015

I don't have a good way to test this but I believe the bug is on the previous line :) in python 3 dict.keys returns a view not a sequence; addr needs to be list(errors.keys())

@nchammas
Copy link
Author

@nchammas nchammas commented Nov 7, 2015

Oh, you're right. The traceback even gives it away. :derp:

@bitprophet
Copy link
Member

@bitprophet bitprophet commented Nov 9, 2015

Rollin' into the PR, thanks @nchammas / @edk0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants