Message261315
It would be possible for subprocess to replace "%1" with the filename parsed from the command line and then re-raise the exception. That said, it's not as if this is a deficiency in the Windows implementation relative to subprocess on POSIX. For example, in 3.4 on Linux it raises a generic ENOEXEC error:
>>> os.access('./test.txt', os.X_OK)
True
>>> subprocess.call(['./test.txt'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/subprocess.py", line 537, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error
It could provide the filename, for example:
>>> raise OSError(errno.ENOEXEC, os.strerror(errno.ENOEXEC), './test.txt')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 8] Exec format error: './test.txt'
A new issue should be raised to fix the FormatMessage calls in the standard library that mistakenly leave out FORMAT_MESSAGE_IGNORE_INSERTS. |
|
Date |
User |
Action |
Args |
2016-03-07 21:21:25 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, Raúl Núñez de Arenas |
2016-03-07 21:21:25 | eryksun | set | messageid: <1457385685.11.0.597021824948.issue26493@psf.upfronthosting.co.za> |
2016-03-07 21:21:25 | eryksun | link | issue26493 messages |
2016-03-07 21:21:24 | eryksun | create | |
|