[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-05-01 Thread Eryk Sun
Eryk Sun added the comment: > I suspect that we've not used the flags in those ones because we > think we *can* properly format the message, so fixing the use of > inserts is a better option than simply going back to the > unformatted message. We're advised that it's "unsafe to take an

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-05-01 Thread Steve Dower
Steve Dower added the comment: > I suggested creating a new issue to fix the calls that omit this flag. Right, that's a separate issue that is easily fixed (and backported, IMHO). Though I suspect that we've not used the flags in those ones because we think we *can* properly format the

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-30 Thread Eryk Sun
Eryk Sun added the comment: >> A new issue should be raised to fix the FormatMessage calls in the >> standard library that mistakenly leave out >> FORMAT_MESSAGE_IGNORE_INSERTS. > > Do you suggest to modify OSError constructor to modify the call to > FormatMessageW(): don't pass the

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-30 Thread Raúl Núñez de Arenas
Raúl Núñez de Arenas added the comment: That's the kind of patch I assumed was created for the Windows part, Berker, that's why I reopened the issue. Thanks for the information. -- ___ Python tracker

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-29 Thread Berker Peksag
Berker Peksag added the comment: FYI, in msg261315, Eryk has mentioned about possible improvement of the exception message on POSIX. The filename has been added to the exception message in 8621bb5d93239316f97281826461b85072ff6db7: >>> import subprocess, os >>> os.access('log.txt', os.X_OK)

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-29 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-29 Thread Raúl Núñez de Arenas
Raúl Núñez de Arenas added the comment: Hi Steve :) I assumed that the issue was solved, that's why I warned, in case a patch was applied and it didn't work. When I did read "I suggest to only call reformat_strerror() when an user complains", I supposed a patch was ready O:) No big deal, I

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-29 Thread Steve Dower
Steve Dower added the comment: It still happens because nobody has proposed a patch to specially handle this one particular error code. The earlier messages explained why we can't do formatting on error messages. If this one is particularly common, then it's best for it to be handled in

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2019-04-29 Thread Raúl Núñez de Arenas
Raúl Núñez de Arenas added the comment: I'm sorry to say that this still happens in Python 3.7.0... -- ___ Python tracker ___ ___

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-08 Thread STINNER Victor
STINNER Victor added the comment: See also issue #25585: "DLL load failed: %1 is not a valid Win32 application" message of ImportError exception. Hum, so maybe a function is better, since ImportError doesn't inherit from OSError. -- ___ Python

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-08 Thread STINNER Victor
STINNER Victor added the comment: > A new issue should be raised to fix the FormatMessage calls in the standard > library that mistakenly leave out FORMAT_MESSAGE_IGNORE_INSERTS. Do you suggest to modify OSError constructor to modify the call to FormatMessageW(): don't pass the

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-08 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-07 Thread Eryk Sun
Eryk Sun added the comment: 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

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-06 Thread Raúl Núñez de Arenas
Raúl Núñez de Arenas added the comment: Thanks for the information, Eryk, I've read the blog. -- ___ Python tracker ___

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-06 Thread Eryk Sun
Eryk Sun added the comment: When Python creates an exception generically from a Windows error code, it calls WinAPI FormatMessage with the flag FORMAT_MESSAGE_IGNORE_INSERTS. The reason for this is explained in a blog post written by Raymond Chen[1]: "when you are not in control of the

[issue26493] Bad formatting in WinError 193 when using subprocess.check_call

2016-03-06 Thread Raúl Núñez de Arenas
New submission from Raúl Núñez de Arenas: 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',