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

sshtunnel 0.0.8 doesn't work Windows #49

Closed
pgolec opened this issue Mar 13, 2016 · 2 comments
Closed

sshtunnel 0.0.8 doesn't work Windows #49

pgolec opened this issue Mar 13, 2016 · 2 comments

Comments

@pgolec
Copy link

pgolec commented Mar 13, 2016

Release 0.0.8 won't work on Windows.

Specifically, socketserver doesn't expose UnixStreamServer on Windows. Since _UnixStreamForwardServer inherits from socketserver.UnixStreamServer, merely importing sshtunnel results in an Exception being raised on Windows.

@luddwichr
Copy link

Unfortunately, Release 0.0.8.1 it still doesn't work on Windows. I am using Python 3.5.1 (64-Bit) and Paramiko 1.15.3. I am getting the following error message:

Traceback (most recent call last):
    File "...\test.py", line 2, in <module> from sshtunnel import SSHTunnelForwarder
    File "...\lib\site-packages\sshtunnel.py", line 378, in <module> class _UnixStreamForwardServer(UnixStreamServer, _ForwardServer):
TypeError: Cannot create a consistent method resolution order (MRO) for bases _ForwardServer, TCPServer

I made the script work by removing lines 57--60 and replacing lines 377-387 with:

if os.name == 'posix':
    class _UnixStreamForwardServer(socketserver.UnixStreamServer, _ForwardServer):
        """
        Serve over UNIX domain sockets (does not work on Windows)
        """

        @property
        def local_host(self):
            return None

        @property
        def local_port(self):
            return None
else:
    class _UnixStreamForwardServer(_ForwardServer):
        """
        Serve over UNIX domain sockets (does not work on Windows)
        """

        @property
        def local_host(self):
            return None

        @property
        def local_port(self):
            return None

I didn't work myself into the script really, so does this make sense at all? The docstring even says "Serve over UNIX domain sockets (does not work on Windows)", so it might make sense to only define it for Posix-based OSes?

@fernandezcuesta
Copy link
Collaborator

I see, it's inheriting twice from TCPServer and python3 doesn't like that. Thanks for reporting!

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

3 participants