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: Undefined unicode characters should be non-printable
Type: Stage:
Components: Unicode Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, georg.brandl
Priority: normal Keywords:

Created on 2008-07-04 13:30 by amaury.forgeotdarc, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg69254 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-04 13:29
str.isprintable() returns True for undefined unicode code points:

>>> c = "\ufffe"
>>> unicodedata.category(c)
'Cn'             # (Other, Not Assigned)
>>> c.isprintable()
True

Same for "\u0242", "\ufb12"...

The cause is probably in unicodectype.c: _PyUnicode_IsPrintable():
    return (ctype->flags & NONPRINTABLE_MASK) == 0;
but ctype->flags is 0 for undefined chars.
msg69261 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-04 15:55
Should be fixed in r64701...
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47532
2008-07-04 15:55:28georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg69261
nosy: + georg.brandl
2008-07-04 13:30:05amaury.forgeotdarccreate