Message147603
I appreciated the quick turnaround on this.
Perhaps I am misunderstanding the resolution. I understand that strip uses _PyUnicode_IsWhitespace, and that _PyUnicode_IsWhitespace "Returns 1 for Unicode characters having the bidirectional type 'WS', 'B' or 'S' or the category 'Zs', 0 otherwise." However, perhaps this is where the functionality is missing?
Upon further inspection, it looks like there may be other missing white-space characters, such as U+FEFF, "Zero Width No-Break Space". Whatever unicode categories their in, they're still a form of white-space and should still be removed, no?
This was not the behavior I expected from strip().
This affects string.issspace() as well. I now have to put var.strip().strip(u'\u200B\ufeff') anywhere I want to test for whitespace strings in all my future python code. (I was bit by exactly this issue in my code which is what caused me to file the issue in the first place.) |
|
Date |
User |
Action |
Args |
2011-11-14 16:14:55 | mankyd | set | recipients:
+ mankyd, loewis, ezio.melotti |
2011-11-14 16:14:55 | mankyd | set | messageid: <1321287295.23.0.839628268177.issue13391@psf.upfronthosting.co.za> |
2011-11-14 16:14:54 | mankyd | link | issue13391 messages |
2011-11-14 16:14:54 | mankyd | create | |
|