seomoz / qless-py

Python Bindings for qless
MIT License
47 stars 25 forks source link

Windows: Signal attribute error 'SIGQUIT' #59

Open stanvn opened 6 years ago

stanvn commented 6 years ago

I'm trying to run the qless-py-worker on windows. When I execute the qless-py-worker with Python 2 it all works fine, however for some job dependencies I need Python 3. So when I'm trying to execute the worker with python 3 it gives me the error AttributeError: module 'signal' has no attribute 'SIGQUIT' Any idea how to solve this?

neilmb commented 6 years ago

(EDIT: I see this is windows) https://docs.python.org/3/library/signal.html#signal.signal suggests that on Windows there may not be a SIGQUIT in the signal module.

Can you run python -c "import signal; print signal.SIGQUIT" on Python2 and python -c "import signal; print(signal.SIGQUIT)" on Python3 and see what is present in that module on your python installations?

stanvn commented 6 years ago

I've made a small mistake, it worked with python 2 because I ran it in a linux virtual machine terminal. When I run python -c "import signal; print signal.SIGQUIT" under windows it gives the following error for both python 3 and python 2: module 'signal' has no attribute 'SIGQUIT'.

So it is more a Windows issue than a python issue. Is there a way to make it work under windows?

b4hand commented 6 years ago

I'm not aware of anyone using qless on Windows. It's definitely not a supported configuration. Furthermore, there's been no interest in any developer maintaining Windows support for qless, so you're unlikely to find much help.

I'm not sure how critical the signal handlers are to the workers, but I suspect this isn't the only portability issue that you'd face running under Windows as there's been no attempt at testing its functionality under Windows. You could try removing the signal handler and seeing what other issues there are.

dlecocq commented 6 years ago

The signal-handling in the workers is only really important for shutting them down. As far as other potential issues with Windows, I'm not entirely sure how os is meant to work on Windows, especially WRT fork and wait and so forth.

Unfortunately I don't have access to a Windows machine to test out the functionality. Philosophically, I don't want to preclude the possibility of using Windows, but for this kind of package I don't imagine many people would be wanting to use Windows.