[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)
Eryk Sun
report at bugs.python.org
Thu Jul 20 19:26:29 EDT 2017
Eryk Sun added the comment:
subprocess.Popen calls WinAPI CreateProcess, which can execute PE/COFF executables and .BAT/.CMD batch scripts. It doesn't know anything about .LNK shell shortcuts. If CreateProcess fails, a Windows shell (e.g. CMD or PowerShell) tries ShellExecuteEx, which knows how to open a .LNK file. You can use shell=True for this in Python.
Directly supporting ShellExecuteEx would be a major enhancement. It would probably require a new keyword-only parameter, or at least a sentinel value for the existing `shell` parameter.
----------
nosy: +eryksun
versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30979>
_______________________________________
More information about the Python-bugs-list
mailing list