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.

classification
Title: Issue warning when LC_NUMERIC is not "C"
Type: enhancement Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, draghuram, jhermann
Priority: normal Keywords:

Created on 2001-04-26 15:08 by jhermann, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (3)
msg61061 - (view) Author: Jürgen Hermann (jhermann) Date: 2001-04-26 15:08
In Py_Initialize(), check that the locale setting for 
LC_NUMERIC is "C" (and issue some sort of warning if 
not, e.g. assert() that setting), as required by 
section 6.22.2 of the Python 2.0 library reference.

I'd rather have my embedded interpreter exit() than 
having VERY strange or even unnoticed problems with 
floating point constants.

The problem I had and that triggered this request was 
this:

Traceback (most recent call last):
  File "cgi-bin/test.py", line 7, in ?
    import random
  File "./random.py", line 93, in ?
    verify('NV_MAGICCONST', 1.71552776992141)
  File "./random.py", line 78, in verify
    raise ValueError, \
ValueError: computed value for NV_MAGICCONST deviates 
too much (computed 2.82843, expected 1)
msg61062 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-05-12 23:34
Logged In: YES 
user_id=357491

As of Python 2.3b1, the section is now 6.26.2 (locale: For extension writers 
and programs that embed Python) and it actually says "that the LC_NUMERIC 
locale should always be "C" ".  There is no explicit requirement.

Couldn't you do your own check for LC_NUMERIC's value in your own code 
and raise SystemExit if it isn't set to "C"?
msg62098 - (view) Author: Raghuram Devarakonda (draghuram) (Python triager) Date: 2008-02-06 15:12
Closing as there is no activity for long time.
History
Date User Action Args
2022-04-10 16:04:00adminsetgithub: 34419
2008-02-06 15:12:14draghuramsetstatus: open -> closed
nosy: + draghuram
messages: + msg62098
2001-04-26 15:08:15jhermanncreate