[issue9200] str.isprintable() is always False for large code points

2010-11-26 Thread Alexander Belopolsky
Alexander Belopolsky 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. At this point the goal is mostly

[issue9200] str.isprintable() is always False for large code points

2010-11-26 Thread Alexander Belopolsky
Alexander Belopolsky 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 dependency and if there are no objection

[issue9200] str.isprintable() is always False for large code points

2010-07-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 same way, of course

[issue9200] str.isprintable() is always False for large code points

2010-07-09 Thread Adam Olsen
Adam Olsen added the comment: There should be a way to walk the unicode string in Python too. Afaik there isn't. -- nosy: +Rhamphoryncus ___ Python tracker ___

[issue9200] str.isprintable() is always False for large code points

2010-07-08 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc : 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 points are stored with