process-isolation icon indicating copy to clipboard operation
process-isolation copied to clipboard

AttributeError on import on win32

Open fraxen opened this issue 11 years ago • 2 comments

Hi, The machine is Win7 Urtimate 64-bit, Python is 2.7.5 32-bit.

I have used pip to install process_isolation, and that went well.

Now, when I try to import process_isolation I get:

    186         if not cls._installed:
    187             cls._installed = True
--> 188             signal.signal(signal.SIGCHLD, cls._handle_sigchld)
    189
    190 ChildProcessSignalHandler._install()

AttributeError: 'module' object has no attribute 'SIGCHLD'

fraxen avatar Mar 18 '14 07:03 fraxen

SIGCHLD isn't supported on Windows. I just commented this and a few other lines out on my windows implementation and haven't seen any ill affects, though to be fair I don't implement all the aspects of process-isolation.

Here is a workaround that someone coded that might be worth looking into: https://github.com/kanaka/websockify/commit/3ee9ff7f4d5b27c77c75e246d4ac8d642049b02f

jsexauer avatar Mar 18 '14 12:03 jsexauer

Commenting out line 188 as @jsexauer suggests will work fine so long as the child process (i.e. the one being isolated) does not hard crash. (A hard crash means an exit due to a segfault or other signal not caught at the python level - ordinary python exceptions do not count as hard crashes). In case of a hard crash, SIGCHLD notifies the parent process that something went wrong. If you comment out line 188, then if the child process crashes and you later try to call some function in the child process, then the parent process will just hang forever. So if you don't expect hard crashes then it should be fine to comment line 188.

alexflint avatar Mar 18 '14 14:03 alexflint