This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author peter.otten
Recipients ngie, peter.otten
Date 2013-11-19.18:50:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384887047.4.0.849993022887.issue19657@psf.upfronthosting.co.za>
In-reply-to
Content
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("#")]
History
Date User Action Args
2013-11-19 18:50:47peter.ottensetrecipients: + peter.otten, ngie
2013-11-19 18:50:47peter.ottensetmessageid: <1384887047.4.0.849993022887.issue19657@psf.upfronthosting.co.za>
2013-11-19 18:50:47peter.ottenlinkissue19657 messages
2013-11-19 18:50:47peter.ottencreate