New submission from Bernát Gábor: Although python27.exe.lnk is callable from any command line tool, with any of its arguments the subprocess module thinks it's not a valid Win32 application.
Proof, let there be python27.exe.lnk be a shortcut to python.exe: C:\Python27 λ ls python* python.exe* python27.exe.lnk* pythonw.exe* λ python.exe -c "import sys; print(sys.version)" 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] C:\Python27 λ python.exe -c "import subprocess; print(subprocess.call(['./python.exe', '-c', '\"import sys; print(sys.version)\"']))" 0 C:\Python27 λ python27.exe -c "import subprocess; print(subprocess.call(['./python27.exe.lnk', '-c', '\"import sys; print(sys.version)\"']))" Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Python27\lib\subprocess.py", line 168, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 390, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 640, in _execute_child startupinfo) WindowsError: [Error 193] %1 is not a valid Win32 application ---------- components: Windows messages: 298752 nosy: Bernát Gábor, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App) type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30979> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com