New submission from Árni Már Jónsson: When switching to a turkish locale, the codecs registry fails on a codec lookup which worked before the locale change.
This happens when the codec name contains an uppercase 'I'. What happens, is just before doing a cache lookup, the string is normalized, which includes a call to <ctype.h>'s tolower. tolower is locale dependant, and the turkish locale handles 'I's different from other locales. Thus, the lookup fails, since the normalization behaves differently then it did before. Replacing the tolower() call with this made the lookup work: int my_tolower(char c) { if ('A' <= c && c <= 'Z') c += 32; return c; } PS: If the turkish locale is not supported, this here will enable it to an Ubuntu system a) sudo cp /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/local (or just copy the lines with "tr" in them) b) sudo dpkg-reconfigure locales ---------- components: Interpreter Core files: verify_locale.py messages: 59821 nosy: arnimar severity: normal status: open title: Codec lookup failing under turkish locale type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file9140/verify_locale.py __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1813> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com