[EMAIL PROTECTED] wrote: > Hi Brock, > > >> Webrev: >> http://cr.opensolaris.org/~bpytlik/ips-5212-v1/ >> > > client/query_engine.py: > > - line 124: Is this assert safe? The documentation for readline() > seems to imply that it's entirely valid to get a '\n' as your > string. > > readline([size]) > Read one entire line from the file. A trailing newline > character is kept in the string (but may be absent when > a file ends with an incomplete line). > http://www.python.org/doc/2.4.4/lib/bltin-file-objects.html > That line hasn't changed (other than being moved wholesale from the query_engine. I believe it is safe, barring corrupted index files (in the sense that someone opened them in VI and went to town) in which case I think I'd like to blow up. On line 122, we should be seeking to the beginning of a line of text I know to be non-empty because it contains the information for that search hit. Thus, the line should not be empty. If the line is empty, then either someone's mucked with the files, or there's a serious programming error in the code that means that results returned are untrustworthy. In both situations, I think failing an assert is a reasonable reaction.
Does that make sense? Thanks for taking the time to review this. Brock > Everthing else looks fine to me. > > Thanks, > > -j > _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
