[New-bugs-announce] [issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)
Bernát Gábor
report at bugs.python.org
Thu Jul 20 18:32:04 EDT 2017
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 <report at bugs.python.org>
<http://bugs.python.org/issue30979>
_______________________________________
More information about the New-bugs-announce
mailing list