Open scfarley opened 4 years ago
https://stackoverflow.com/questions/32612235/what-is-os-name-on-cygwin
Looks like os.name
yields posix
on cygwin, I'm not sure it's going to work
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?
With commit 5a20db1f06a4b1bba5015881ffe218678d7ec085, 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: