[Python-Dev] What is test__locale supposed to test, anyhow?

Jack Jansen Jack.Jansen at cwi.nl
Thu Jul 15 13:07:10 CEST 2004


On 15 Jul 2004, at 07:02, Nick Bastin wrote:
>> But not on OS X.  It raises TestSkipped saying how locale support is 
>> so minimal that it isn't worth testing.
>
> Yeah, I'm going remove that and test it out...that message may be 
> bogus at this point - it was put there a year and a half ago by Jack, 
> and I'm reasonably sure that no one's tested it since (and I don't 
> believe it anyhow - it's more like Python's support is bad - MacOS X's 
> support for locale is pretty good).

MacOSX's support for locale was abysmal up to 10.2, a trait which it 
inherited from FreeBSD. It is much better under 10.3 (but still 
completely separate from the MacOSX native way to specify currency 
signs and what have you).

But it seems the C library doesn't use the locale info, here's the 
output from test_locale (from cvs head, on 10.3.4):

'%f' % 1024 =? '1,024.000000' ... no
'%f' % 1024 == '1024.000000' != '1,024.000000'
'%f' % 102 =? '102.000000' ... yes
'%f' % -42 =? '-42.000000' ... yes
'%+f' % -42 =? '-42.000000' ... yes
'%20.f' % -42 =? '                 -42' ... yes
'%+10.f' % -4200 =? '    -4,200' ... no
'%+10.f' % -4200 == '     -4200' != '    -4,200'
'%-10.f' % 4200 =? '4,200     ' ... no
'%-10.f' % 4200 == '4200      ' != '4,200     '

--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman



More information about the Python-Dev mailing list