1

Resolved

PythonScraper.py does not correctly quote arguments when calling ExtensionScraper.py

description

Specifically, it does not quote the second sys.executable, which becomes argv[0] (but does not appear in sys.argv). If the interpreter has a space in the path, it becomes argv[0] and argv[1], which affects the files that the script looks for.

This affects CPython interpreters that have spaces in their paths and .pyd files in site-packages.

The workaround is to add quotes to the second sys.executable in the spawnl call at the end of PythonScraper.py:
os.spawnl(os.P_WAIT, 
        sys.executable,
        "\"" + sys.executable + "\"",
        "\"" + os.path.join(os.path.dirname(__file__), 'ExtensionScraper.py') + "\"",
        'scrape',
        pkg_name,
        '-',        # providing __import__ name rather than a path
        "\"" + os.path.join(outpath, pkg_name) + "\""
)

comments

Zooba wrote Apr 15 at 11:19 PM

Fixed in 2.0 feature branch