[issue13427] string comparison with ==

2011-11-18 Thread Ezio Melotti
Ezio Melotti added the comment: Nope, str.strip only strips whitespace, and \x00 is not considered whitespace: >>> '\x00'.isspace() False -- nosy: +ezio.melotti resolution: works for me -> invalid ___ Python tracker

[issue13427] string comparison with ==

2011-11-18 Thread Alan
Alan added the comment: Using repr highlights the issue which lies in the behaviour of str.strip() which does not strip away null spaces as I would have expected: ' 'utm10\x00' ' == ' 'utm10' ' not equal Changing the code to: currColl=line.split(":")[1].strip().strip("\0") works but I think

[issue13427] string comparison with ==

2011-11-18 Thread Florent Xicluna
Changes by Florent Xicluna : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue13427] string comparison with ==

2011-11-18 Thread Florent Xicluna
Florent Xicluna added the comment: collName is probably not what you expect. You can print repr(collName), repr(currColl) to verify this. It is not a bug on Python side. -- nosy: +flox resolution: -> works for me stage: -> committed/rejected status: open -> pending _

[issue13427] string comparison with ==

2011-11-18 Thread Alan Beccati
New submission from Alan Beccati : Hello, did I discover a python string comparison bug or is this behaviour expected and I am doing something wrong? This is the code I run: for line in lines[4:]: currColl=line.split(":")[1].strip() print "'",currColl,"'","==","'",collName,"'"