thanx for your help but record = blast_iterator.next() gives the same error.
traceback (most recent call last):
File "blast2.py", line 46, in <module>
record = blast_iterator.next()
File "/usr/lib/pymodules/python2.7/Bio/Blast/NCBIStandalone.py", line 1659, in next
return self._parser.parse(File.StringHandle(data))
File "/usr/lib/pymodules/python2.7/Bio/Blast/NCBIStandalone.py", line 818, in parse
self._scanner.feed(handle, self._consumer)
File "/usr/lib/pymodules/python2.7/Bio/Blast/NCBIStandalone.py", line 112, in feed
read_and_call_until(uhandle, consumer.noevent, contains='BLAST')
File "/usr/lib/pymodules/python2.7/Bio/ParserSupport.py", line 337, in read_and_call_until
line = safe_readline(uhandle)
File "/usr/lib/pymodules/python2.7/Bio/ParserSupport.py", line 413, in safe_readline
raise ValueError("Unexpected end of stream.")
ValueError: Unexpected end of stream.
I don't know what is the reason?
The message "Unexpected end of stream." means the parser reached the end of the file before it expected it. Either your file is truncated, or the format has changed slightly (again). I hope you'd read the tutorial which warns that the plain text parser is fragile and this is (almost) to be expected if you try the latest BLAST release?