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.

Title: Add check for locale.h
Type: enhancement Stage: resolved
Components: Build, Cross-Build Versions: Python 3.6
Status: closed Resolution: duplicate
Dependencies: Superseder: Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined
View: 22747
Assigned To: Nosy List: Roman.Evstifeev, benjamin.peterson, cavallo71, doko, pitrou, python-dev, skrah, vstinner, xdegaye
Priority: normal Keywords: patch

Created on 2013-05-04 14:09 by cavallo71, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit cavallo71, 2013-05-04 14:09 review cavallo71, 2013-05-11 23:10 review
Messages (9)
msg188362 - (view) Author: Antonio Cavallo (cavallo71) Date: 2013-05-04 14:09
This patch adds check for the locale.h file in addition to langinfo.h. The patch contains also a fix to Python/fileutils.c file.

The android ndk provides locale.h but no langinfo.h: this fixes the issue.

BTW bionic doesn't have any runtime support for locale at the moment in the standard build at least.
msg188913 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-05-11 12:30
There are more places where including locale.h is guarded by HAVE_LANGINFO_H.

Also, there are places where including locale.h isn't guarded by anything (such as Python/formatter_unicode.c), so I don't think we need the new configure check.
msg188940 - (view) Author: Antonio Cavallo (cavallo71) Date: 2013-05-11 18:36
I see, in that case wouldn't make more sense completely remove the check for the langinfo.h either?

I think is better to close the issue to keep the noise low.
msg188942 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-05-11 18:38
You might have misunderstood me. Since locale.h appears to exist on all systems (including Android) there's no need to add a check for it in configure. On the other hand, it is correct to fix the existing guards like your patch proposes to do, except that there appears to be more places to fix.

I'm reopening the issue.
msg188969 - (view) Author: Antonio Cavallo (cavallo71) Date: 2013-05-11 23:10
ok I see it, thanks.

I've attached a new patch fixing the files with the locale's guards.

Modules/readline.c might have the SAVE_LOCALE renamed into HAVE_SETLOCALE but the patch doesn't address that bit.

Android has definitively locale.h but it is a dummy implementation at the moment. I'm trying with instead but still no luck.
msg264159 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-04-25 07:59
Android API level 21 has a full fledged locale.h now.
There is still no langinfo.h, this issue is a duplicate of issue #22747.
msg264195 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2016-04-25 19:17
Okay, closing as a duplicate (the second patch here that checks for
locale.h seems too broad to me since it's a standard header).
msg264196 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-25 19:39
New changeset cc501d439239 by Stefan Krah in branch 'default':
Issue #17905: Do not guard locale include with HAVE_LANGINFO_H.
msg264197 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2016-04-25 19:43
I think all locale includes are unguarded now.
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62105
2016-04-27 10:33:32Roman.Evstifeevsetnosy: + Roman.Evstifeev
2016-04-25 19:43:12skrahsetmessages: + msg264197
2016-04-25 19:39:24python-devsetnosy: + python-dev
messages: + msg264196
2016-04-25 19:17:11skrahsetstatus: open -> closed

superseder: Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined
versions: + Python 3.6, - Python 3.4
nosy: + skrah

messages: + msg264195
resolution: duplicate
stage: resolved
2016-04-25 07:59:27xdegayesetnosy: + xdegaye
messages: + msg264159
2013-05-11 23:10:46cavallo71setfiles: +

messages: + msg188969
2013-05-11 18:38:25pitrousetstatus: closed -> open
resolution: works for me -> (no value)
messages: + msg188942
2013-05-11 18:36:26cavallo71setstatus: open -> closed
resolution: works for me
messages: + msg188940
2013-05-11 12:30:14pitrousetnosy: + pitrou
messages: + msg188913
2013-05-10 19:15:40terry.reedysetversions: - Python 3.5
2013-05-04 14:09:13cavallo71create