[Python-Dev] Dealing with test__locale failure on OS X before a3
Brett C.
bac at OCF.Berkeley.EDU
Fri Aug 27 01:41:10 CEST 2004
Martin v. Löwis wrote:
> Brett C. wrote:
>
>> Personally I would like to turn off the test on OS X for now and then
>> try to see if there is a proper way to solve this.
>
>
> In what way does that help? The test shows that the locale module is
> broken on OS X. So the only sensible options are to remove the module
> (or atleast the relevant functions), or to fix them.
I have an idea for detecting a broken setlocale. When configure.in does
its compiling does it compile with the same flags that the Makefile
uses for compiling? If it does we can test for something we know will
be different (fr_FR has a different decimal point, for instance) and
compare them and then have a value in pyconfig.h to signal that a busted
setlocale exists. setlocale can then raise locale.Error automatically
for platforms that have that macro defined. But the test has to be
compiled with the ``-framework CoreFoundation`` option or else this
won't work.
The reason I don't want to do a blanket ``#ifdef __APPLE__`` solution is
because I don't know if this was an issue in OS X 10.2 or earlier
(http://www.hmug.org/man/3/setlocale.html seems to suggest setlocale was
deprecated which means it may have still worked).
-Brett
More information about the Python-Dev
mailing list