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: Space character returns false from isprintable() method
Type: behavior Stage: commit review
Components: Versions: Python 3.0, Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: LambertDW, amaury.forgeotdarc, benjamin.peterson, dlfjessup, georg.brandl, ishimoto, loewis, pitrou
Priority: high Keywords: patch

Created on 2009-02-01 21:02 by dlfjessup, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
5126.diff ishimoto, 2009-02-02 04:32
Messages (7)
msg80919 - (view) Author: (dlfjessup) Date: 2009-02-01 21:01
I am running IDLE on Windows XP.  The version information when IDLE
boots is:

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32

I ran the following test case:

    >>> ' '.isprintable()
    False

However, according to
http://docs.python.org/3.0/library/stdtypes.htm#str.isprintable, "...the
ASCII space (0x20) ... is considered printable."

This seems pretty broken to me.
msg80920 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-01 21:11
Confirmed here.
msg80921 - (view) Author: David W. Lambert (LambertDW) Date: 2009-02-01 21:46
Python 3.0rc1+ (py3k, Nov  5 2008, 14:44:46) [GCC 3.4.6 20060404 (Red 
Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" 
for more information.
>>> ' '.isprintable()  # probably no surprise:
False
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'
msg80922 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-02-01 22:11
This was introduced in r64701, which failed to include the space into
PRINTABLE_MASK (issue 3282); it was excluded from NONPRINTABLE_MASK before.
msg80929 - (view) Author: Atsuo Ishimoto (ishimoto) * Date: 2009-02-02 04:32
I'm sorry, looks like my fault.

I attached a patch to fix issue. This patch contains re-generated
unicodetype_db.h. I downloaded Unicode 5.1.0 and Unicode 3.2.0 files
from unicode.org to re-generate.
msg84183 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-03-26 16:44
The patch seems good.
msg84187 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-26 17:16
Fixed in r70610.
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49376
2009-03-26 17:16:04benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg84187

resolution: accepted -> fixed
2009-03-26 16:44:02amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg84183

resolution: accepted
stage: test needed -> commit review
2009-02-02 04:32:40ishimotosetfiles: + 5126.diff
keywords: + patch
messages: + msg80929
2009-02-01 22:11:39loewissetmessages: + msg80922
2009-02-01 21:46:44LambertDWsetnosy: + LambertDW
messages: + msg80921
2009-02-01 21:31:53loewissetnosy: + loewis
2009-02-01 21:11:56pitrousetpriority: high
nosy: + georg.brandl, pitrou, ishimoto
stage: test needed
messages: + msg80920
versions: + Python 3.1
2009-02-01 21:02:07dlfjessupcreate