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.

classification
Title: questionable results from IDLE, Windows, & several built-in
Type: Stage:
Components: Windows Versions: Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bavantgarde314, josiahcarlson
Priority: normal Keywords:

Created on 2007-04-15 08:28 by bavantgarde314, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
idle_question.py bavantgarde314, 2007-04-15 08:28 Python routine that reveals questionable behaviour
Messages (4)
msg31793 - (view) Author: bavantgarde314 (bavantgarde314) Date: 2007-04-15 08:28
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32

Windows(ME)


Attachment reveals questionable results from IDLE, Windows, & several built-in functions.
        
Under IDLE: function swapcase() updates 120 characters.
Under Windows (dos-screen) or a Windows ide swapcase() updates only 52 characters: ord values 65-90 for (uppercase)A-Z and 97-122 for (lowercase)a-z.
                   
Under IDLE: functions lower() & upper() return different results than swapcase()
for hex values:  8a,  8c,  8e,  9a,  9c,  9e,  9f, ff  
 or ord values  138, 140, 142, 154, 156, 158, 159, 255
 or characters   Š    Å’    Ž    š    Å“    ž    Ÿ    ÿ


msg31794 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2007-04-19 05:02
The behaviors of those functions depend on the locale.

Check the results of:

import locale
locale.getlocale()
msg31795 - (view) Author: bavantgarde314 (bavantgarde314) Date: 2007-04-21 07:33
Thanks

import locale
locale.setlocale(locale.LC_ALL, '')

solved my problems.
msg31796 - (view) Author: bavantgarde314 (bavantgarde314) Date: 2007-04-21 07:36
Thanks

import locale
locale.setlocale(locale.LC_ALL, '')

solved my problems.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44850
2007-04-15 08:28:46bavantgarde314create