essandess / isp-data-pollution

ISP Data Pollution to Protect Private Browsing History with Obfuscation
MIT License
590 stars 53 forks source link

" AttributeError: module 'signal' has no attribute 'SIGALRM' " #14

Closed Exirtis closed 7 years ago

Exirtis commented 7 years ago

First, thank you for all of your help thus far. I really appreciate it.

To recap my setup: I'm running Windows 10 with Python 3.6, selenium, numpy, requests, Faker, and phantomjs installed.

After you updated the script to check for the availability of nice, I ran the updated script and encountered the following error:

Traceback (most recent call last):
  File "isp_data_pollution.py", line 483, in <module>
    ISPDataPollution(debug=True)
  File "isp_data_pollution.py", line 116, in __init__
    signal.signal(signal.SIGALRM, self.phantomjs_hang_handler) # register hang handler
AttributeError: module 'signal' has no attribute 'SIGALRM'

I won't even try speculating what's going on here, since I think my prior guesses haven't been very useful.

essandess commented 7 years ago

This is a nontrivial problem because I explicitly use this UNIX signal to handle when phantomjs hangs. I was hoping that this got translated to W10 behind the scenes but apparently not.

Would you or someone please Google and suggest Python code to handle timeouts of a hung subprocess on Windows?

Exirtis commented 7 years ago

Would you or someone please Google and suggest Python code to handle timeouts of a hung subprocess on Windows?

I'll look around and see what I can find.