From e4524b8aec9b1a174a99609c0a7e311b6ed2732a Mon Sep 17 00:00:00 2001 From: Federico Leva Date: Mon, 24 Feb 2020 18:14:34 +0200 Subject: [PATCH] launcher.py: Avoid shell=True to consume half as many processes No idea if "python2" will be converted to anything meaningful on Windows, but then you're not really supposed to use the shell either in that dungeon. https://docs.python.org/2.7/library/subprocess.html#subprocess.Popen --- launcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher.py b/launcher.py index 2f2068c..708635a 100644 --- a/launcher.py +++ b/launcher.py @@ -82,9 +82,9 @@ def main(): # typically they don't provide any crawl-delay value in their robots.txt). if started and wikidir: #then resume print 'Resuming download, using directory', wikidir - subprocess.call('./dumpgenerator.py --api=%s --xml --images --resume --path=%s' % (wiki, wikidir), shell=True) + subprocess.call(['python2', 'dumpgenerator.py', '--api={}'.format(wiki), '--xml', '--images', '--resume', '--path={}'.format(wikidir)], shell=False) else: #download from scratch - subprocess.call('./dumpgenerator.py --api=%s --xml --images --delay=1' % wiki, shell=True) + subprocess.call(['python2', 'dumpgenerator.py', '--api={}'.format(wiki), '--xml', '--images'], shell=False) started = True #save wikidir now for f in os.listdir('.'):