yes, it has and I have the latest installed libiconv on the system. I repeated the steps from the post-install script after I've found out that shr4_64.o is missing.
I don't know either what could lead to the problem but because I saw enough messages about libiconv problems here in the forum and IRL, I think there should be a better solution...
Original Message:
Sent: Tue December 19, 2023 08:02 AM
From: Ayappan P
Subject: python3.9: unsupported locale setting
Okay. libiconv rpm has post install script which actually takes the shared objects from /usr/lib/libiconv.a and add it to /opt/freeware/lib/libiconv.a.
Not sure whether any scenario exists where this script fails to add shr4_64.o to /opt/freeware/lib/libiconv.a archive.
# rpm -q --scripts libiconv
postinstall scriptlet (using /bin/sh):
# we need to include all shared members of the system wide /usr/lib/libiconv.a
# at rpm installation time to avoid core dump of system binaries
export AR="/usr/bin/ar -X32_64"
/usr/bin/mkdir -p /tmp/libiconv.tmp
cd /tmp/libiconv.tmp
/usr/sbin/slibclean
LIST=`${AR} -t /usr/lib/libiconv.a`
${AR} -x /usr/lib/libiconv.a
/usr/bin/strip -X32_64 -e *
/usr/bin/cp -f /opt/freeware/lib/libiconv.a .
for i in ${LIST}
do
if [ "$i" != "libiconv.so.2" ]; then
echo "add $i shared members from /usr/lib/libiconv.a to /opt/freeware/lib/libiconv.a"
${AR} -r libiconv.a ${i}
fi
done
/usr/bin/cp -f libiconv.a /opt/freeware/lib/libiconv.a
cd -
/usr/bin/rm -rf /tmp/libiconv.tmp
------------------------------
Ayappan P
Original Message:
Sent: Tue December 19, 2023 07:45 AM
From: Andrey Klyachkin
Subject: python3.9: unsupported locale setting
It looks like I ocasionally found the cause of the problem.
shr4_64.o was missing in /opt/freeware/lib/libiconv.a. After I added it into libiconv.a, I don't get 'unsupported locale setting' anymore:
#/opt/freeware/bin/python3.9Python 3.9.18 (main, Sep 19 2023, 04:57:07) [GCC 10.3.0] on aixType "help", "copyright", "credits" or "license" for more information.>>> import locale>>> locale.setlocale(locale.LC_ALL, '')'EN_US EN_US EN_US EN_US EN_US EN_US'
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Tue December 19, 2023 07:09 AM
From: Ayappan P
Subject: python3.9: unsupported locale setting
Hi Andrey,
Thanks for reporting it. We will check it out and update.
------------------------------
Ayappan P
Original Message:
Sent: Tue December 19, 2023 06:25 AM
From: Andrey Klyachkin
Subject: python3.9: unsupported locale setting
Did one more test on the system with the problem.
32-bit python (/opt/freeware/libexec/python3.9_32) works without problems:
# /opt/freeware/libexec/python3.9_32Python 3.9.18 (main, Sep 19 2023, 04:59:07) [GCC 10.3.0] on aixType "help", "copyright", "credits" or "license" for more information.>>> import locale>>> locale.setlocale(locale.LC_ALL)'C EN_US C C C C'>>> locale.setlocale(locale.LC_ALL, '')'EN_US EN_US EN_US EN_US EN_US EN_US'>>>
The problem is only with 64-bit Python.
btw I am not the only one with the problem. I was contacted from several customers if I found a solution to the problem.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Tue September 05, 2023 12:26 PM
From: Andrey Klyachkin
Subject: python3.9: unsupported locale setting
If I try to set locale in python3.9 from AIX toolbox, I get the error 'unsupported locale setting':
#python3.9Python 3.9.17 (main, Jul 5 2023, 06:17:22) [GCC 10.3.0] on aixType "help", "copyright", "credits" or "license" for more information.>>> import locale>>> locale.setlocale(locale.LC_ALL, '')Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/freeware/lib64/python3.9/locale.py", line 610, in setlocale return _setlocale(category, locale)locale.Error: unsupported locale setting
If I do the same with AIX standard python3.9 everything is OK:
#python3Python 3.9.12 (main, Apr 19 2022, 06:10:02) [IBM XL C/C++ for AIX 13.1.3.7] on aixType "help", "copyright", "credits" or "license" for more information.>>> import locale>>> locale.setlocale(locale.LC_ALL, '')'en_US.UTF-8 en_US.UTF-8 en_US.UTF-8 en_US.UTF-8 en_US.UTF-8 en_US.UTF-8'>>> dummy, encoding=locale.getlocale()>>> dummy'en_US'>>> encoding'UTF-8'>>>
The locale is installed and everything looks fine for me:
#echo $LANGen_US.UTF-8#locale -aCPOSIXEN_US.UTF-8EN_USen_US.8859-15en_US.IBM-858en_US.ISO8859-1en_US.UTF-8en_US
I have the problem on this one server. All other work without problems. What could be the cause of the problem?
------------------------------
Andrey Klyachkin
https://www.power-devops.com
------------------------------