[Patches] [ python-Patches-798145 ] nl_langinfo(RADIXCHAR) wrong

SourceForge.net noreply at sourceforge.net
Sun Aug 31 08:15:29 EDT 2003


Patches item #798145, was opened at 2003-08-31 09:12
Message generated for change (Comment added) made by jepler
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=798145&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Epler (jepler)
>Assigned to: Martin v. Löwis (loewis)
Summary: nl_langinfo(RADIXCHAR) wrong

Initial Comment:
See
http://google.com/groups?as_umsgid=m3d6empnsq.fsf%40mira.informatik.hu-berlin.de

The following code prints RADIXCHAR from the C locale, not from the chosen locale (fr_FR and many other european locales should give ','

from locale import setlocale, LC_NUMERIC, nl_langinfo, RADIXCHAR
setlocale(LC_NUMERIC, "fr_FR")
print nl_langinfo(RADIXCHAR)

The patch assumes that the value nl_langinfo() should give for RADIXCHAR and THOUSEP are the same as localeconv()['decimal_point'] and ['thousands_sep'].  It assumes that if RADIXCHAR is defined then THOUSEP is (just as above code does), 

How can I write a test for this?  Presumably many platforms (Windows?) won't provide a complete set of locales.  

----------------------------------------------------------------------

>Comment By: Jeff Epler (jepler)
Date: 2003-08-31 09:15

Message:
Logged In: YES 
user_id=2772

Here's one approach to testing: I created a list of all the locales that my system supports which have a differing RADIXCHAR.  The test is intended to try all of them, skip if none are found, and fail if any are found but nl_langinfo() disagrees with localeconv()

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=798145&group_id=5470



More information about the Patches mailing list