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 vstinner
Recipients Arfrever, Ariel.Ben-Yehuda, berker.peksag, chris.jerdonek, eric.smith, ezio.melotti, loewis, serhiy.storchaka, vstinner
Date 2012-09-20.12:03:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1348142629.01.0.828345024438.issue15276@psf.upfronthosting.co.za>
In-reply-to
Content
> I can't reproduce this with Python 2.7.3.
> >>> locale.setlocale(locale.LC_NUMERIC, 'fr_FR')
> 'fr_FR'
> >>> u'{:n}'.format(10000)
> u'10 000'

I don't understand why, but the all french locales are the same. Some "french locale" uses the standard ASCII space (U+0020) as thousand seperator, others use the non-breaking space (U+00A0). I suppose that some systems prefer to avoid non-ASCII characters to avoid "Unicode issues".

On Ubuntu 12.04, locale.localeconv()['thousands_sep'] is chr(32) for the locale fr_FR.utf8.

You may need to install other locales to test this issue. For example, the ps_AF locale uses U+066b as the decimal point and the thousands separator.

I chose to not fix the issue in Python 3.2 because it needs to change too much code (and I don't want to introduce a regression and 3.2 code is very different than 3.3). You should upgrade to Python 3.3, or reimplement the Unicode format() function for numbers using locale.localeconv() ('thousands_sep', 'decimal_point' and 'grouping') :-/

Or find a more motivated developer. Or I can do the job if you pay me ;-)

(Read also the issue #13706 for more information.)
History
Date User Action Args
2012-09-20 12:03:49vstinnersetrecipients: + vstinner, loewis, eric.smith, ezio.melotti, Arfrever, chris.jerdonek, berker.peksag, serhiy.storchaka, Ariel.Ben-Yehuda
2012-09-20 12:03:49vstinnersetmessageid: <1348142629.01.0.828345024438.issue15276@psf.upfronthosting.co.za>
2012-09-20 12:03:48vstinnerlinkissue15276 messages
2012-09-20 12:03:47vstinnercreate