The attached patch corrects a number of errors in the usage of PyErr_Format, for the Mac specific modules. It should be reviewed for technical correctness wrt. the Apple API, and also wrt. whether the patch changes generated files. In particular, the error corrections are: - OSErr is a 16-bit value, can't parse with 'i' - MusicMIDIPacket::data is UINT8[249], parsing it with s# won't work, as s# outputs a char*. I *assume* QtMusicMIDIPacket_Convert wants to get the string into the data buffer - In Qt_TuneSetHeader, an int* is passed to an 's' argument. Not sure whether this is correct: shouldn't there be a requirement that the string is a multiple of sizeof(int) in length? - SndCmd_Convert parses a char* into a long. This is correct in terms of size for both 32-bit and 64-bit systems. Is it also correct logically? (i.e. is param2 really a pointer?) - TXNScrollBarState is a single-byte type - ScrapFlavorFlags is an unsigned type - Boolean is a single-byte type - CFStringEncoding is now parsed through a long temporary variable, as it's not clear what format code would be correct
Note, all of the patched files are for deprecated modules that have been removed in Python 3 so the only applicability now could be as a bug fix to 2.7. At this late date, though, I don't think it is worth worrying about trying to review and test the patches.