This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Raúl Núñez de Arenas
Recipients Raúl Núñez de Arenas
Date 2016-03-06.16:56:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za>
In-reply-to
Content
Python 3.5.1 x64 @ Windows 10 x64

The error message in the traceback for OSError/WinError 193 has bad formatting and the offending file name is not printed.

For example, this code:
----
import subprocess

testfile = open('testfile.notexecutable', 'wb')
testfile.close()
subprocess.check_call(['testfile.notexecutable'])
----

produces this output:
----
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    subprocess.check_call(['testfile.notexecutable'])
  File "C:\Program Files\Python35\lib\subprocess.py", line 579, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Program Files\Python35\lib\subprocess.py", line 560, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Program Files\Python35\lib\subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python35\lib\subprocess.py", line 1220, in _execute_child
    startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application
----

Please note the "%1 is not a valid..." on the last line. Instead of the "%1" placeholder, the filename ("testfile.notexecutable") should appear instead.

Thanks :)
History
Date User Action Args
2016-03-06 16:56:29Raúl Núñez de Arenassetrecipients: + Raúl Núñez de Arenas
2016-03-06 16:56:29Raúl Núñez de Arenassetmessageid: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za>
2016-03-06 16:56:29Raúl Núñez de Arenaslinkissue26493 messages
2016-03-06 16:56:29Raúl Núñez de Arenascreate