[BioPython] Problems with NCBIXML.py

Peter biopython at maubp.freeserve.co.uk
Tue Oct 23 18:14:43 UTC 2007


Bruno Santos wrote:
> I have manually checked the file and I didn't found any problem.
> Sorry about the three times it was my mistake because I send the message
> before register and then I thought I had to send it again.
> This is getting stranger every time I ran the script it gave me a different
> error. Now I get this one at the first run:
 >
 > ...
> 
> Now if I run the script without first close it I get the following error:
> Traceback (most recent call last):
> 

Without seeing the XML file I'm having to guess - but this could be 
something to do with trying to read files from disk before the OS has 
finished flushing the data out.  Mismatched tags could certainly be 
explained if the parser was only getting part of the data.

You could try inserting a sleep of a few seconds after writing and 
closing the XML file.  Also try handle.flush() before the handle.close() 
when you save the XML file to disk.

> I have upload my script, the FASTA file I'm using and the XML can anyone
> give a look?
> 
> XML File: http://www.drivehq.com/folder/p2731454.aspx
> Script: http://www.drivehq.com/folder/p2731447.aspx
> FASTA File: http://www.drivehq.com/folder/p2731426.aspx

That didn't work - the easy solution is to file a bug, and then attach 
the three files:

http://bugzilla.open-bio.org/enter_bug.cgi?product=Biopython

Peter




More information about the Biopython mailing list