diff --git a/lib/galaxy/datatypes/xml.py b/lib/galaxy/datatypes/xml.py index d9e659bd70c..ef1f1623e28 100644 --- a/lib/galaxy/datatypes/xml.py +++ b/lib/galaxy/datatypes/xml.py @@ -104,13 +104,41 @@ class BlastXml( GenericXml ): for f in split_files: h = open(f) body = False - header = [] + header = h.readline() + if not header: + out.close() + h.close() + raise ValueError("BLAST XML file %s was empty" % f) + if header.strip() != '': + out.write(header) #for diagnosis + out.close() + h.close() + raise ValueError("%s is not an XML file!" % f) + line = h.readline() + header += line + if line.strip() not in ['', + '']: + out.write(header) #for diagnosis + out.close() + h.close() + raise ValueError("%s is not a BLAST XML file!" % f) while True: line = h.readline() - header.append(line) + if not line: + out.write(header) #for diagnosis + out.close() + h.close() + raise ValueError("BLAST XML file %s ended prematurely" % f) + header += line if "" in line: break - header = "".join(header) + if len(header) > 10000: + #Something has gone wrong, don't load too much into memory! + #Write what we have to the merged file for diagnostics + out.write(header) + out.close() + h.close() + raise ValueError("BLAST XML file %s has too long a header!" % f) if "" not in header: out.close() h.close() diff --git a/scripts/check_python.py b/scripts/check_python.py index 15017c9d2c0..e6fdc00a7c0 100644 --- a/scripts/check_python.py +++ b/scripts/check_python.py @@ -1,14 +1,14 @@ import os, sys msg = """ERROR: Your Python version is: %s -Galaxy is currently supported on Python 2.4, 2.5 and 2.6. To run Galaxy, +Galaxy is currently supported on Python 2.5, 2.6 and 2.7. To run Galaxy, please download and install a supported version from python.org. If a supported version is installed but is not your default, getgalaxy.org contains instructions on how to force Galaxy to use a different version.""" % sys.version[:3] def check_python(): try: - assert sys.version_info[:2] >= ( 2, 4 ) and sys.version_info[:2] <= ( 2, 7 ) + assert sys.version_info[:2] >= ( 2, 5 ) and sys.version_info[:2] <= ( 2, 7 ) except AssertionError: print >>sys.stderr, msg raise diff --git a/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml b/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml index dbefac05d6e..6b942380403 100644 --- a/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml @@ -1,6 +1,6 @@ Search nucleotide database with nucleotide query sequence(s) - + blastn -version hide_stderr.py diff --git a/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml b/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml index 0f7d0a7c8ee..17dda06e5e1 100644 --- a/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml @@ -1,6 +1,6 @@ Search protein database with protein query sequence(s) - + blastp -version hide_stderr.py diff --git a/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml b/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml index cda16a5f34f..487c433ee1b 100644 --- a/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml @@ -1,6 +1,6 @@ Search protein database with translated nucleotide query sequence(s) - + blastx -version hide_stderr.py diff --git a/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml b/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml index 2d6ece29b92..73cead395d8 100644 --- a/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml @@ -1,6 +1,6 @@ Search translated nucleotide database with protein query sequence(s) - + tblastn -version hide_stderr.py diff --git a/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml b/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml index e65ed289bd4..bb96f972a9c 100644 --- a/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml @@ -1,6 +1,6 @@ Search translated nucleotide database with translated nucleotide query sequence(s) - + tblastx -version hide_stderr.py