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.

Author vstinner
Recipients alanh, r.david.murray, vstinner
Date 2013-09-16.19:35:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379360135.39.0.813943260423.issue19036@psf.upfronthosting.co.za>
In-reply-to
Content
It looks like a real issue, but on which platform did you get the error?

> setlocale fails due to locale.h being wrapped up in LANGINFO check.

What do you mean by "fail"? Is it an error at runtime? Or during the compilation?

--

The include was added recently:

changeset:   81257:c256764e2b3f
branch:      3.2
parent:      81253:c4a4863b85b2
user:        Victor Stinner <victor.stinner@gmail.com>
date:        Thu Jan 03 01:08:58 2013 +0100
files:       Misc/NEWS Objects/unicodeobject.c Python/fileutils.c
description:
Issue #16455: On FreeBSD and Solaris, if the locale is C, the
ASCII/surrogateescape codec is now used, instead of the locale encoding, to
decode the command line arguments. This change fixes inconsistencies with
os.fsencode() and os.fsdecode() because these operating systems announces an
ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.


The commit was integrated in Python 3.2.5 and Python 3.3.2 .

If I remember correctly, I copied/pasted the code from Python/pythonrun.c:

#ifdef HAVE_LANGINFO_H 
#include <locale.h>
#include <langinfo.h>
#endif

Many other files use "#include <locale.h>" without #ifdef HAVE_LANGINFO_H: Modules/main.c, Modules/python.c, Modules/readline.c, Python/frozenmain.c, Python/pystrtod.c and Modules/_localemodule.c. The #include in Modules/main.c was added 5 years ago by changeset 22a74eaf6b22.
History
Date User Action Args
2013-09-16 19:35:35vstinnersetrecipients: + vstinner, r.david.murray, alanh
2013-09-16 19:35:35vstinnersetmessageid: <1379360135.39.0.813943260423.issue19036@psf.upfronthosting.co.za>
2013-09-16 19:35:35vstinnerlinkissue19036 messages
2013-09-16 19:35:34vstinnercreate