Message 341225 - Python tracker

Message341225

Author eryksun
Recipients Raúl Núñez de Arenas, berker.peksag, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-05-01.18:28:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556735305.17.0.66499157398.issue26493@roundup.psfhosted.org>
In-reply-to
Content
> 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 arbitrary system error code returned from an API and use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS". We don't control the content of system error messages. If we get the number and type of arguments wrong for the message inserts, then FormatMessageW may fail with an invalid parameter error, as it does in the examples I showed, or return nonsense, or even crash the process due to an unhandled access violation. 

Also, nothing was implemented in _overlapped.FormatMessage or _ctypes.FormatError to special case an `Arguments` array for particular error codes, or even to expose this capability to Python code. I think omitting the flag was just a mistake.
History
Date User Action Args
2019-05-01 18:28:25eryksunsetrecipients: + eryksun, paul.moore, tim.golden, berker.peksag, zach.ware, steve.dower, Raúl Núñez de Arenas
2019-05-01 18:28:25eryksunsetmessageid: <1556735305.17.0.66499157398.issue26493@roundup.psfhosted.org>
2019-05-01 18:28:25eryksunlinkissue26493 messages
2019-05-01 18:28:25eryksuncreate