[New-bugs-announce] [issue23017] string.printable.isprintable() returns False

Steve Ward report at bugs.python.org
Tue Dec 9 04:52:01 CET 2014


New submission from Steve Ward:

string.printable includes all whitespace characters.  However, the only whitespace character that is printable is the space (0x20).


By definition, the only ASCII characters considered printable are:
    alphanumeric characters
    punctuation characters
    the space character (not all whitespace characters)


Source:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03

7.2 POSIX Locale

Conforming systems shall provide a POSIX locale, also known as the C locale.


7.3.1 LC_CTYPE

space
    Define characters to be classified as white-space characters.

    In the POSIX locale, exactly <space>, <form-feed>, <newline>, <carriage-return>, <tab>, and <vertical-tab> shall be included.

cntrl
    Define characters to be classified as control characters.

    In the POSIX locale, no characters in classes alpha or print shall be included.

graph
    Define characters to be classified as printable characters, not including the <space>.

    In the POSIX locale, all characters in classes alpha, digit, and punct shall be included; no characters in class cntrl shall be included.

print
    Define characters to be classified as printable characters, including the <space>.

    In the POSIX locale, all characters in class graph shall be included; no characters in class cntrl shall be included.


LC_CTYPE Category in the POSIX Locale

# "print" is by default "alnum", "punct", and the <space>

----------
components: Library (Lib)
files: bug-string-ascii.py
messages: 232343
nosy: planet36
priority: normal
severity: normal
status: open
title: string.printable.isprintable() returns False
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file37391/bug-string-ascii.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23017>
_______________________________________


More information about the New-bugs-announce mailing list