[ python-Bugs-997768 ] LC_CTYPE locale and strings

SourceForge.net noreply at sourceforge.net
Mon Jul 26 03:36:21 CEST 2004


Bugs item #997768, was opened at 2004-07-26 04:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=997768&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Pekka Pessi (ppessi)
Assigned to: Nobody/Anonymous (nobody)
Summary: LC_CTYPE locale and strings

Initial Comment:
It would be nice to get access to complete
locale-specific ctype information:

iscntrl()
isgraph()
isprint()
ispunct()

Also, the string.uppercase and string.lowercase depend
on LC_CTYPE locale. The string module has two other
members that could depend on LC_CTYPE,
string.punctuation and string.printable.

The current docs (in
http://www.python.org/doc/2.3.4/lib/module-string.html)
on string.printable is misleading, as string.printable
is not changed after LC_CTYPE locale changes, and it is
always
printable = digits + ascii_letters + punctuation +
whitespace

My approach is to create string.printable and
string.punctuation based on locale information, just
like string.uppercase and string.lowercase is done, and
add string.ascii_punctuation and string.ascii_printable
for the C locale values.

Patch containing proposed changes in stringobject,
string and _locale modules attached. No tests nor
changes to the docs, sorry.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=997768&group_id=5470


More information about the Python-bugs-list mailing list