Mailing List Archive

[issue5126] Space character returns false from isprintable() method
Antoine Pitrou <pitrou@free.fr> added the comment:

Confirmed here.

----------
nosy: +georg.brandl, ishimoto, pitrou
priority: -> high
stage: -> test needed
versions: +Python 3.1

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5126>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5126] Space character returns false from isprintable() method [ In reply to ]
New submission from dlfjessup <dljessup@gmail.com>:

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.

----------
messages: 80919
nosy: dlfjessup
severity: normal
status: open
title: Space character returns false from isprintable() method
type: behavior
versions: Python 3.0

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5126>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5126] Space character returns false from isprintable() method [ In reply to ]
Changes by Martin v. Löwis <martin@v.loewis.de>:


----------
nosy: +loewis

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5126>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5126] Space character returns false from isprintable() method [ In reply to ]
David W. Lambert <lambertdw@corning.com> added the comment:

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'

----------
nosy: +LambertDW

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5126>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5126] Space character returns false from isprintable() method [ In reply to ]
Martin v. Löwis <martin@v.loewis.de> added the comment:

This was introduced in r64701, which failed to include the space into
PRINTABLE_MASK (issue 3282); it was excluded from NONPRINTABLE_MASK before.

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5126>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue5126] Space character returns false from isprintable() method [ In reply to ]
Atsuo Ishimoto <ishimoto@gembook.org> added the comment:

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.

----------
keywords: +patch
Added file: http://bugs.python.org/file12915/5126.diff

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue5126>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com