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.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc
Date 2008-07-04.13:29:59
SpamBayes Score 0.15046208
Marked as misclassified No
Message-id <1215178206.2.0.370394116016.issue3282@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-07-04 13:30:07amaury.forgeotdarcsetspambayes_score: 0.150462 -> 0.15046208
recipients: + amaury.forgeotdarc
2008-07-04 13:30:06amaury.forgeotdarcsetspambayes_score: 0.150462 -> 0.150462
messageid: <1215178206.2.0.370394116016.issue3282@psf.upfronthosting.co.za>
2008-07-04 13:30:04amaury.forgeotdarclinkissue3282 messages
2008-07-04 13:30:03amaury.forgeotdarccreate