Apparently choking on this line: elif not line.startswith('TABLE ') or not line[6:] in self.tables: raise SyntaxError, 'invalid file format'
Does your file look OK when taking this into consideration? Hard to think linefeeds are the problem but you could try saving the file in the various formats (Unix, Windows, Mac).