[Python-Dev] Dealing with test__locale failure on OS X before a3

Bob Ippolito bob at redivi.com
Fri Aug 27 04:32:12 CEST 2004


On Aug 26, 2004, at 9:54 PM, Brett C. wrote:

> Nick Bastin wrote:
>
>> I think we should actually just fix this, rather than removing locale 
>> support for MacOS X builds.  The trick is that we need to call 
>> __setonlyClocaleconv() again, to remove the protection against 
>> calling setlocale() in framework builds (why they did this in the 
>> first place is beyond me).  Seems like it should be an easy gate 
>> against darwin, and then call that on startup.
>
> I don't like that solution since that function is obviously not part 
> of any public API.

Well there are two ways to fix it:

1) Call __setonlyClocaleconv() if it's there via weak linking or 
whatnot around any setlocale or the like.  This will at least affect OS 
X 10.3, I'm not sure about 10.2, and the rumor says it's fixed "now" in 
10.4.

2) Write a whole new module that uses Apple API for localization.

Obviously 2 is the "best" solution, but requires the most time.  1 is 
easy-ish and will work reliably on all the machines that need it 
(assuming the rumor is correct) unless Apple does something totally 
strange and changes the behavior of a previous-release OS for reasons 
other than security flaws :)

-bob


More information about the Python-Dev mailing list