[issue13427] string comparison with ==

2011-11-18 Thread Alan Beccati
New submission from Alan Beccati alan.becc...@gmail.com: 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

[issue13427] string comparison with ==

2011-11-18 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com 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 -

[issue13427] string comparison with ==

2011-11-18 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13427 ___ ___

[issue13427] string comparison with ==

2011-11-18 Thread Alan
Alan alan.becc...@gmail.com 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)

[issue13427] string comparison with ==

2011-11-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com 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