possible newline problems

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Tue Nov 18 01:33:02 EST 2008


Robocop wrote:

>   for line in fileinput.input(['/proc/mounts']):

This will include the newline at the end of every line.

>     if line == 'sshfs#root at website.com:/usr/home/sites/www.website.com/
> web/PICTURES/django /www/htdocs/hatProductAdd/media/images/PICTURES/
> django fuse rw,nosuid,nodev,user_id=0,group_id=0,max_read=65536 0 0':

You're comparing the line against a string that doesn't end with a newline.



More information about the Python-list mailing list