It can throw an exception is lines is not something which a __len__ method...