You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
With commit 5a20db1, UNIX domain sockets was introduced, yet it only supports Linux and MacOS (Darwin). Additional systems can easily be added. There are a few options, but I am not sure which is best. Here is what I am currently using:
diff --git a/pythonx/neovim_rpc_server.py b/pythonx/neovim_rpc_server.py
index d669fd0..055bbc0 100644
--- a/pythonx/neovim_rpc_server.py+++ b/pythonx/neovim_rpc_server.py@@ -296,7 +296,10 @@ class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass
-if sys.platform in ['linux', 'darwin']:+# if sys.platform in ['freebsd11', 'linux', 'darwin']:+# if platform.system() in ['Darwin', 'DragonFly', 'FreeBSD', 'Linux', 'NetBSD',+# 'OpenBSD']:+if os.name == 'posix':
class ThreadedUnixServer(socketserver.ThreadingMixIn,
socketserver.UnixStreamServer):
pass
The test for posix is the most broad, but I do not know if it would include any systems that cannot handle it. While sys.platform would work, it would grow fairly quickly since the BSD's all have the version of the OS appended to them. There is finally platform.system() which is basically uname -s which would work too and be easier than sys.platform.
Another alternative is to try defining the class and handle the exception. It should work everywhere:
diff --git a/pythonx/neovim_rpc_server.py b/pythonx/neovim_rpc_server.py
index d669fd0..ca278c6 100644
--- a/pythonx/neovim_rpc_server.py+++ b/pythonx/neovim_rpc_server.py@@ -296,12 +296,12 @@ class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass
-if sys.platform in ['linux', 'darwin']:+try:
class ThreadedUnixServer(socketserver.ThreadingMixIn,
socketserver.UnixStreamServer):
pass
has_unix = True
-else:+except:
has_unix = False
The text was updated successfully, but these errors were encountered:
The code can check for posix but exclude cygwin. From what I have read, cygwin does have a form of UNIX domain sockets but cannot pass file descriptors using it.
However, what about trying to instantiate ThreadedUnixServer as the check? Does cygwin have it?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
With commit 5a20db1, UNIX domain sockets was introduced, yet it only supports Linux and MacOS (Darwin). Additional systems can easily be added. There are a few options, but I am not sure which is best. Here is what I am currently using:
The test for
posix
is the most broad, but I do not know if it would include any systems that cannot handle it. Whilesys.platform
would work, it would grow fairly quickly since the BSD's all have the version of the OS appended to them. There is finallyplatform.system()
which is basicallyuname -s
which would work too and be easier thansys.platform
.Another alternative is to try defining the class and handle the exception. It should work everywhere:
The text was updated successfully, but these errors were encountered: