Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
AFAICT, all ctype methods (isalpha, isdigit, etc.) have the same problem. I
posted a patch at issue10542 that introduces a Py_UNICODE_NEXT() macro that can
help fixing all these methods. I am adding #10542 as a
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Attached patch fixes isprintable and other ctype-like methods. I left
isspace() out for now because I could not find a test character outside of BMP
to test with, but I think we should fix that for completeness as well.
Adam Olsen rha...@gmail.com added the comment:
There should be a way to walk the unicode string in Python too. Afaik there
isn't.
--
nosy: +Rhamphoryncus
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9200
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
A proof of concept patch, which shows the macros used to walk a unicode
string and uses them in unicode_repr() (should not change behaviour) and in
unicode_isprintable() (should fix the issue).
Other functions should be changed the
New submission from Amaury Forgeot d'Arc amaur...@gmail.com:
On narrow unicode builds:
unicodedata.category(chr(0x1)) == 'Lo' # correct
Py_UNICODE_ISPRINTABLE(0x1)== 1 # correct
str.isprintable(chr(0x1)) == False # inconsistent
On narrow unicode builds, large code