[Patches] [ python-Patches-774665 ] making Python LC_NUMERIC agnostic

SourceForge.net noreply@sourceforge.net
Mon, 21 Jul 2003 14:52:15 -0700


Patches item #774665, was opened at 2003-07-20 21:39
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=774665&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gustavo J. A. M. Carneiro (gustavo)
Assigned to: Nobody/Anonymous (nobody)
Summary: making Python LC_NUMERIC agnostic

Initial Comment:
  This patch offers conversion string<->float
conversion functions that are locale agnostic.  This
way, Python will be able to run perfectly even when
LC_NUMERIC is set to something other than C.  It
happens frequently when using external modules that
these modules change LC_NUMERIC without python knowing
about it.  It will never stop happening, unfortunately,
so it is best to make python not depend on LC_NUMERIC
being always set to 'C'.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-07-21 23:52

Message:
Logged In: YES 
user_id=21627

On some systems, the desired behaviour just is not
implementable. On such systems, we should not try to
implement it by replacing the standard library. Instead, we
should just give in and not implement the feature. People
using such systems should convince their system vendors to
provide the proper API, or find out whether proper API
already exists.

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

Comment By: Gustavo J. A. M. Carneiro (gustavo)
Date: 2003-07-21 12:06

Message:
Logged In: YES 
user_id=908

  I have to incorporate glib code, otherwise what happens if
glib is not installed? It is my intention that the current
behaviour *never* be preserved.
  Well, that's not exactly an accurate statement.  What I
mean is that str() and float() should keep the current
C-locale behaviour.  
  However, underneath these python functions we could have
LC_NUMERIC set something other than 'C'.  This is vital for
some modules, like GTK+, that depend on LC_NUMERIC to be set
the locale dependent value, otherwise it behaves different
from what the user expects.

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-07-20 23:25

Message:
Logged In: YES 
user_id=21627

I recommend that you do not incorporate the code of glib,
but rather arrange to link with glib (perhaps only if
activated by --with-glib). If no guaranteed-C-locale strtod
is available, the current behaviour should be preserved.

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

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