This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author trentm
Recipients loewis, ronaldoussoren, trentm
Date 2008-10-06.22:27:08
SpamBayes Score 7.21645e-16
Marked as misclassified No
Message-id <>
Revision 63955 removed a block from (and effectively from having to do with endianness that results in an incorrect
setting for "WORDS_BIGENDIAN" in Universal builds on Mac OS X.

The removed part was this:

> [ 	 
>  /* Define to 1 if your processor stores words with the most
significant byte 	 
>     first (like Motorola and SPARC, unlike Intel and VAX). 	 
>     The block below does compile-time checking for endianness on
>     that use GCC and therefore allows compiling fat binaries on OSX by
>     '-arch ppc -arch i386' as the compile flags. The phrasing was
>     such that the configure-result is used on systems that don't use
>   */ 	 
> #ifdef __BIG_ENDIAN__ 	 
> #define WORDS_BIGENDIAN 1 	 
> #else 	 
> #ifndef __LITTLE_ENDIAN__ 	 
> #endif 	 
> #endif])

This used to allow "WORDS_BIGENDIAN" to be correct for all parts of a
universal Python build done via `gcc -arch i386 -arch ppc ...`.

This was originally added for issue 1471883 (see msg50040 for a
discussion of this particular bit).

The result of this bug is that Python extensions using either of the
following to get native byte ordering for UTF-16 decoding:

   PyUnicode_DecodeUTF16(..., byteorder=0);
   PyUnicode_DecodeUTF16Stateful(..., byteorder=0, ...);

on Mac OS X/PowerPC with a universal build built on Intel hardware (most
such builds) will get the wrong byte-ordering.

The fix is to restore that section to and re-run autoconf
and autoheader.


Was there are particular reason that this block was removed from (and

I'd like to hear comments from either Ronald or Martin, and then I can
commit the fix.
Date User Action Args
2008-10-06 22:27:10trentmsetrecipients: + trentm, loewis, ronaldoussoren
2008-10-06 22:27:10trentmsetmessageid: <>
2008-10-06 22:27:09trentmlinkissue4060 messages
2008-10-06 22:27:08trentmcreate