[Pythonmac-SIG] How badly is _locale broken?
I am planning to attempt to fix the _locale module (which 'locale' itself imports and uses) for OS X. As of this exact moment I am planning just fixing localeconv (thanks to CFNumberFormatter and setlocale still at least storing the supposed locale, even if it does ignore it), but I realized other stuff might be broken. Since I never personally use the module, does anyone know the extent of the breakage? Obviously I would rather just have to fix localeconv and keep my life simple, but if it is more extensive I can see what I can do. -Brett ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] How badly is _locale broken?
Bob Ippolito wrote: On Dec 29, 2004, at 5:32 AM, Ronald Oussoren wrote: I know that. But not linking with CoreServices should fix _locale for python scripts that don't use mac-specific features. Well, my patch to remove all non-libSystem dependencies from the Python core was accepted for Python 2.4, so we are already at this point. However, the mac toolbox functions can lazily import CF-using modules. I think the core probably uses some of these functions. Last I remember, the locale module itself linked to CF (directly or indirectly) so it could guess what the current locale should be :) It is directly linked against CoreFoundation (there is function called mac_getstcript() in the extension module that is used to implement locale.getdefaultlocale . The correct fix would probably use CFLocale to implement the _locale module on OSX. Yes, that would be a good fix. Right. As I said I want to use CFNumberFormatter with CFLocale objects to fill in the dict returned by locale.localeconv as best as possible. Alternatively, we could just punt on the issue and say "you need to use 10.X in order to have a working locale module", where 10.X is the version that Apple fixes CF. X is obviously greater than 3, but I don't think it will be much greater. It's been broken for this long, and Brett C. said he doesn't use the locale module, so it may be too much effort for too little reward. I have figured out the mapping of attributes from CFNumberFormatter to locale.localeconv, so doing that shouldn't be too painful. The only serious problem was going to be if there was more breakage (such as strcoll and such) that needed fixing. Dealing with localeconv so that test_locale stops failing (which, as a test, is really weak) should not be too bad. And just leaving 10.3 users out in the cold seems slightly mean, even when 10.4 comes out (due out in 2005, right?). Normally I would say we should just have the entire locale module just raise an exception if it is imported on a version that has this problem, but nl_langinfo actually works so that seems extreme. So I think I will go ahead and fix localeconv and see what 10.4 fixes when it comes out. -Brett ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] fink vs DarwinPorts?
Russell E. Owen wrote: I've seen a lot of discussion lately about fink and darwinports and I'm wondering if folks who have experience with either can comment on their relative merits? I personally have run Fink in the past multiple times and always end up deleting it in the end. DarwinPorts, on the other hand, I have yet to uninstall. The package config files are easy to read by eye (it is basically Tcl code). I also just like how the system is set up using the command line; never liked how Fink works that way. And their idea of activation (can have multiple installs of the same thing with different configs; just activate to choose which one to use) is nice. Plus having Jordan Hubbard on the team is nice (former member of FreeBSD who now works at Apple for those who don't know). =) -Brett ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Python 2.4 test_locale fails?
Jim Correia wrote: (New to the list, couldn't find the answer in the archives...) I'm just getting around to building and installing Python 2.4 on 10.3.8. After building and running the tests, test_locale fails. (If I tweak the test to not abort after the first failure I see that it fails for the decimal_point and thousands_sep for most locales.) Is the test faulty? Is here a bug in Python 2.4? In the 10.3.8 locale support? The bug is in Panther. If you link anything against CoreFoundation it locks out changing the locale through locale.h in C which is what Python uses. While this could be partially fixed by putting a bunch of CF code to use the locale API through that, it was generally agreed that with Tiger about to come out it would be best to wait to see what the situation is then and fix accordingly. -Brett ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig