Bug 726536

Summary: setlocale() fails if LC_CTYPE is set to Turkish locale
Product: [Fedora] Fedora Reporter: Stefan Krah <stefan-usenet>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 14CC: aalam, dennis, fweimer, i18n-bugs, jakub, schwab, stefan-usenet
Target Milestone: ---Keywords: i18n, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.14.90-8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 737778 (view as bug list) Environment:
Last Closed: 2011-09-13 06:11:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Krah 2011-07-28 23:06:18 UTC
Description of problem:

If the current locale is Turkish, setting a new locale fails if
the locale contains an 'I'.


Steps to Reproduce:

Compile and run:

#include <stdio.h>
#include <locale.h>
int
main(void)
{
    char *s;
    printf("%s\n", setlocale(LC_CTYPE, "tr_TR"));
    printf("%s\n", setlocale(LC_CTYPE, NULL));
    s = setlocale(LC_CTYPE, "tr_TR.ISO8859-9");
    printf("%s\n", s ? s : "null");
    return 0;
}

  
Actual results:

[stefan@fedora-14-amd64 ~]$ ./xxx 
tr_TR
tr_TR
null


Expected results:

tr_TR
tr_TR
tr_TR.ISO8859-9


Additional info:

My guess is that somewhere tolower() fails to convert the 'I'
to a proper lowercase 'i' if LC_CTYPE is Turkish.

This issue currently causes failures in the Fedora buildbot for
the Python project:

http://www.python.org/dev/buildbot/all/builders/AMD64%20Fedora%20without%20threads%203.x/builds/457/steps/test/logs/stdio

======================================================================
ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.krah-fedora/build/Lib/test/test_locale.py", line 406, in test_getsetlocale_issue1813
    locale.setlocale(locale.LC_CTYPE, loc)
  File "/home/buildbot/buildarea/3.x.krah-fedora/build/Lib/locale.py", line 538, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

----------------------------------------------------------------------


See also: http://bugs.python.org/issue1813

Comment 1 Stefan Krah 2011-08-02 13:16:14 UTC
The test case works with libc-2.11.1:

   Ubuntu Lucid (libc-2.11.1), OpenSUSE (libc-2.11.1)


But not with:

   Fedora 14 (libc-2.13), Fedora 12 ( libc-2.11.2), Debian lenny (libc-2.7), Gentoo (libc-2.13-r2)



If this is a regression in glibc, perhaps the priority should be
raised (or set).

Comment 2 Fedora Update System 2011-08-15 10:58:02 UTC
glibc-2.14.90-5 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/glibc-2.14.90-5

Comment 3 Fedora Update System 2011-08-15 14:59:55 UTC
glibc-2.14-6 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/glibc-2.14-6

Comment 4 Fedora Update System 2011-08-15 20:25:32 UTC
Package glibc-2.14.90-5:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.14.90-5'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.14.90-5
then log in and leave karma (feedback).

Comment 5 Stefan Krah 2011-08-16 20:51:48 UTC
Since the (automated) message asked me to test: Yes, of course I could,
but all download links for Fedora-16 pre-release still point to
Fedora-15-beta:

http://fedoraproject.org/get-prerelease.html

Is there an easy way (preferably a network install iso) to get Fedora-16 alpha?

Comment 6 Fedora Update System 2011-08-24 15:27:20 UTC
glibc-2.14.90-6 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/glibc-2.14.90-6

Comment 7 Fedora Update System 2011-09-02 07:19:03 UTC
glibc-2.14.90-7 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/glibc-2.14.90-7

Comment 8 Fedora Update System 2011-09-08 15:04:56 UTC
glibc-2.14-7 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/glibc-2.14-7

Comment 9 Fedora Update System 2011-09-13 06:11:14 UTC
glibc-2.14.90-8 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.