Message203414
I believe you are misinterpreting what you are seeing. Empty lines read from a file do not produce an empty string, you get "\n" instead which is true in a boolean context.
Try
[line.split()[0] for line in lines if line.strip() and not line.startswith("#")]
or add an extra check for all-whitespace line
[... if line and not line.isspace() and not line.startswith("#")] |
|
Date |
User |
Action |
Args |
2013-11-19 18:50:47 | peter.otten | set | recipients:
+ peter.otten, ngie |
2013-11-19 18:50:47 | peter.otten | set | messageid: <1384887047.4.0.849993022887.issue19657@psf.upfronthosting.co.za> |
2013-11-19 18:50:47 | peter.otten | link | issue19657 messages |
2013-11-19 18:50:47 | peter.otten | create | |
|