Georg, I think you are right in stating that this is a locale issue...

On my desktop computer where both lower- and uppercase "ASCII" work fine, this is the output:

>>> print "ASCII".lower()
ascii
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'en_US.UTF-8'
>>> print "ASCII".lower()
ascii

And this is the output from the laptop computer where only lowercase "ascii" works:

>>> print "ASCII".lower()
ascii
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'tr_TR.UTF-8'
>>> print "ASCII".lower()
ascII

In Turkish language, the general rule is that letters do not lose their cedillas or dots when changing their cases. So;

lowercase "i" turns into "I-with-a-dot-above" in uppercase
lowercase "i-without-a-dot" turns into "I" in uppercase
uppercase "I-with-a-dot-above" turns into "i" in lowercase
uppercase "I" turns into "i-without-a-dot" in lowercase

However, the letter "i" maps to "I"  in Unicode whatever locale you choose:

>>> print u"kitap".upper()
KITAP

The "I" letter shoud be "I-with-a-dot-above" in the output...

There is an old bug report for this at http://bugs.python.org/msg55478

For example, Elisa, Gazpacho and PyPDF give "KeyError: ‘ROUND_CEiLiNG’" when run under Turkish locale. Here "lowercase "i" letters in the output (CEiLiNG) does indicate a locale failure... However, in Docutils, the letters of the word "ASCII" in the error message do not indicate any problems...:

"LookupError: unknown encoding: ASCII"

"Dotted I" in Turkish is a very big problem for Turkish and non-Turkish programmers. Because there is no way to uppercase the letter "i" correctly in any locale...

Regards,
Firat

Georg Brandl wrote:
>>> 'ASCII' should work; codec names are normalized before lookup, which
>>> includes a lowercasing step.
>>>
>>> However, that lowercasing may not lead to the expected results when
>>> a non-C locale is set and the locale's ASCII upper case letters do
>>> not map to the ASCII lower case letters.
>>>
>>> I remember that Turkish has a different upper case 'i' than other
>>> Latin languages, this may well be the cause here.
>>>
>>> Firat: Can you open a Python shell on both of your computers and do
>>> execute the following commands, showing us the output of each:
>>>
>>>     import locale
>>>     print 'I'.lower()
>>>     print locale.setlocale(locale.LC_ALL, '')
>>>     print 'I'.lower()