Message261268
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 message, you had better pass the FORMAT_MESSAGE_IGNORE_INSERTS flag."
[1]: https://blogs.msdn.microsoft.com/oldnewthing/20071128-00/?p=24353
Some extension modules in the code base get this wrong. For example, ctypes.FormatError() doesn't use FORMAT_MESSAGE_IGNORE_INSERTS, so it fails to get the system error message for ERROR_BAD_EXE_FORMAT (193) and just returns its default string "<no description>":
>>> ctypes.FormatError(193)
'<no description>' |
|
Date |
User |
Action |
Args |
2016-03-06 19:58:45 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, Raúl Núñez de Arenas |
2016-03-06 19:58:45 | eryksun | set | messageid: <1457294325.33.0.938747836746.issue26493@psf.upfronthosting.co.za> |
2016-03-06 19:58:45 | eryksun | link | issue26493 messages |
2016-03-06 19:58:45 | eryksun | create | |
|