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

handle OSError errno 97 when ipv6 is disabled #11

Merged
merged 1 commit into from
May 8, 2018

Conversation

PierluigiGreto
Copy link
Contributor

@PierluigiGreto PierluigiGreto commented May 8, 2018

Hi,
I was using your netconf server library and I came across this error:

Traceback (most recent call last):
  File "server_exmaple.py", line 4, in <module>
    ssh_server = server.SSHServer(server_ctl, host_key="tests/host_key")
  File "/root/pysshutil/sshutil/server.py", line 363, in __init__
    protosocket = socket.socket(proto, socket.SOCK_STREAM)
  File "/usr/lib64/python3.6/socket.py", line 144, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol
Deleting SSHServer(port=0)

This happens when ipv6 is disabled in the OS. (This pull request is related also to pull 7).
I managed to reproduce the error and this solution works fine for me. Please let me know what you think.
Thank you for your work.

Copy link
Owner

@choppsv1 choppsv1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@choppsv1 choppsv1 merged commit b49c74d into choppsv1:master May 8, 2018
@choppsv1
Copy link
Owner

choppsv1 commented May 8, 2018

Thanks for the fix!

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

Successfully merging this pull request may close these issues.

2 participants