Issue 5126: Space character returns false from isprintable() method (original) (raw)

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:45 admin set github: 49376
2009-03-26 17:16:04 benjamin.peterson set status: open -> closednosy: + benjamin.petersonmessages: + resolution: accepted -> fixed
2009-03-26 16:44:02 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: + resolution: acceptedstage: test needed -> commit review
2009-02-02 04:32:40 ishimoto set files: + 5126.diffkeywords: + patchmessages: +
2009-02-01 22:11:39 loewis set messages: +
2009-02-01 21:46:44 LambertDW set nosy: + LambertDWmessages: +
2009-02-01 21:31:53 loewis set nosy: + loewis
2009-02-01 21:11:56 pitrou set priority: highnosy: + georg.brandl, pitrou, ishimotostage: test neededmessages: + versions: + Python 3.1
2009-02-01 21:02:07 dlfjessup create