[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-12-28 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Applied the patch in r67982. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4060

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-07 Thread Trent Mick
Trent Mick [EMAIL PROTECTED] added the comment: Added file: http://bugs.python.org/file11723/pymacconfig.h.patch I'll test that on my end tomorrow -- though it looks like it will work fine. Thanks. -- title: PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-07 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I agree with Trent that this is a bug, and I agree with the second patch (pymacconfig.h.patch2). Mark-Andre, sys.byteorder is not affected because detects the byte order at run-time, not at compile-time. Likewise, in the struct module,

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-07 Thread Ronald Oussoren
Ronald Oussoren [EMAIL PROTECTED] added the comment: Annoyingly enough my patch isn't good enough, it turns out that ctypes has introduced a SIZEOF__BOOL definition in configure.in and that needs special caseing as well. pymacconfig.h.patch2 fixes that issue as well. Do you have access to a

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-07 Thread Trent Mick
Trent Mick [EMAIL PROTECTED] added the comment: I get: sizeof(_Bool)=4 bytes on a G4 PPC. Same thing on a G5 PPC: $ cat main.c #include stdio.h int main(void) { printf(sizeof(_Bool) is %d\n, sizeof(_Bool)); } $ gcc main.c $ ./a.out sizeof(_Bool) is 4 -- title:

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-07 Thread Ronald Oussoren
Ronald Oussoren [EMAIL PROTECTED] added the comment: On 7 Oct, 2008, at 18:29, Trent Mick wrote: Trent Mick [EMAIL PROTECTED] added the comment: I get: sizeof(_Bool)=4 bytes on a G4 PPC. Same thing on a G5 PPC: $ cat main.c #include stdio.h int main(void) {

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-07 Thread Trent Mick
Trent Mick [EMAIL PROTECTED] added the comment: What if you compile using 'gcc -arch ppc64 main.c'? $ gcc -arch ppc64 main.c $ ./a.out sizeof(_Bool) is 1 As you figured out. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4060

[issue4060] PyUnicode_DecodeUTF16(..., byteorder=0) gets it wrong on Mac OS X/PowerPC

2008-10-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment: Does this also affect sys.byteorder and the struct module ? I think those would be more important to get right than the UTF-16 codec, since this only uses the native byte ordering for increased performance and compatibility with other OS