maaaaz / webscreenshot

A simple script to screenshot a list of websites
GNU Lesser General Public License v3.0
653 stars 162 forks source link

preexec_fn is not supported on Windows platforms #45

Closed pwndizzle closed 4 years ago

pwndizzle commented 4 years ago

When running on Windows 10 and Python 3.8.0 I received the below error:

python webscreenshot.py google.com
webscreenshot.py version 2.8

[+] 1 URLs to be screenshot
[ERROR][General] Unknown error: preexec_fn is not supported on Windows platforms, exiting
[+] 0 actual URLs screenshot
[+] 1 error(s)
    http://google.com:80

As a quick fix removing "preexec_fn=group_subprocesses" from the call to Popen (shown below) seemed to resolve this. You may want to consider removing this or looking at alternatives.

p = subprocess.Popen(shlex.split(command, posix=not(is_windows())), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=group_subprocesses)
maaaaz commented 4 years ago

Hello @pwndizzle,

Good catch. I anticipated this bug but reading subprocess documentation I thought that Python would automatically discard that preexec_fn function call outside POSIX environments. I have been wrong and will fix it.

Cheers.

maaaaz commented 4 years ago

Hello, bug fixed in v2.9.