[PythonCE] Python 2.4.3 for Windows CE / ARM

Jan Ischebeck mail at jan-ischebeck.de
Sat Apr 8 13:14:37 CEST 2006


Dear Luke,

both float("2,2") and float("2.2") don't work. They raise an 
"ValueError: invalid literal for float(): 2.2".
Current locale is "Deutsch" (german word for "german"). After setting 
the locale to LC_ALL it is still
"Deutsch".

According to localeconv| 'decimal_point' is "," but this should not have 
any influence on float(),
as there is a specific locale depend function for this conversion.

When I call locale.atof("2,2") I get the following error:
Traceback(most recent call last):
File "binaries\lib\locale.py", line 173, in atof
ValueError: invalid literal for float():2.2

Although the locale stuff seems to be somehow mixed up, could it be that 
float("") is
calling a locale depend wince function in python 2.4 ?

Jan
| 
Luke Dunstan schrieb:
> Interesting. What happens if you try float("2,2")? If that works then I 
> guess PythonCE must be using your user default locale instead of the "C" 
> locale. It looks like this locale-based float conversion feature was added 
> in Python 2.4 but I am guessing that on the PC the default locale is "C" 
> unless you explicitly change it? The output of this should confirm it:
>
> import locale
> locale.setlocale(locale.LC_ALL)
> locale.localeconv()
>
> I'm not very familiar with locale programming so I'm not sure how to fix it 
> yet.
>
> Luke
>
> ----- Original Message ----- 
> From: <ivom.doppido at libero.it>
> To: "coder_infidel" <coder_infidel at hotmail.com>
> Sent: Friday, April 07, 2006 9:12 PM
> Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM
>
>
> Dear Luke,
> I've the same problem of Jan:
>   
>>>> float("2.2")
>>>>         
> ValueError: invalid literal for float():2.2
>
> bye
>
> ivom
> italy
>
>
>   
>> ----- Original Message ----- 
>> From: "Jan Ischebeck" <mail at jan-ischebeck.de>
>> To: "Luke Dunstan" <coder_infidel at hotmail.com>; <pythonce at python.org>
>> Sent: Friday, April 07, 2006 4:46 PM
>> Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM
>>
>>
>>     
>>> Dear Luke,
>>>
>>> thanks for the great work.
>>>
>>> I found a small regression:
>>>
>>> float("2.2")
>>>
>>> works on win32 and linux python 2.4, but raises an error using the new
>>> build.
>>>
>>> Jan
>>>       
>> It works for me:
>>
>> Python 2.4.3 (#0, Apr  4 2006, 23:48:52) [MSC v.1201 32 bit (Unknown)] on
>> Pocket PC
>>     
>>>>> float("2.2")
>>>>>           
>> 2.2000000000000002
>>
>> What error do you get?
>>
>> Luke
>>
>>     
>>> Luke Dunstan schrieb:
>>>       
>>>> A new release of Python for Windows CE is available. Download it here:
>>>>
>>>> http://sourceforge.net/project/showfiles.php?group_id=104228
>>>>
>>>> The release notes are linked from this page, but a direct link is:
>>>>
>>>> http://sourceforge.net/project/shownotes.php?release_id=407232&group_id=104228
>>>>
>>>>
>>>> Luke
>>>> _______________________________________________
>>>> PythonCE mailing list
>>>> PythonCE at python.org
>>>> http://mail.python.org/mailman/listinfo/pythonce
>>>>
>>>>
>>>>
>>>>         
>>>       
>> _______________________________________________
>> PythonCE mailing list
>> PythonCE at python.org
>> http://mail.python.org/mailman/listinfo/pythonce
>>
>>     
>
> _______________________________________________
> PythonCE mailing list
> PythonCE at python.org
> http://mail.python.org/mailman/listinfo/pythonce
>
>
>   



More information about the PythonCE mailing list