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

SourceForge.net noreply@sourceforge.net
Mon, 21 Jul 2003 03:06:30 -0700


Patches item #774665, was opened at 2003-07-20 20:39
Message generated for change (Comment added) made by gustavo
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: Gustavo J. A. M. Carneiro (gustavo)
Date: 2003-07-21 11: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 22: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