jlec        14/05/07 11:00:43

  Added:                SffIO_broken_padding.patch
                        SffIO_error_in_check_eof.patch
  Log:
  sci-biology/biopython: Import changes from sci overlay
  
  (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 
B9D4F231BD1558AB!)

Revision  Changes    Path
1.1                  sci-biology/biopython/files/SffIO_broken_padding.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/biopython/files/SffIO_broken_padding.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/biopython/files/SffIO_broken_padding.patch?rev=1.1&content-type=text/plain

Index: SffIO_broken_padding.patch
===================================================================
diff --git a/Bio/SeqIO/SffIO.py b/Bio/SeqIO/SffIO.py
index 735d55b..b89cf41 100644
--- a/Bio/SeqIO/SffIO.py
+++ b/Bio/SeqIO/SffIO.py
@@ -933,12 +933,20 @@ def _check_eof(handle, index_offset, index_length):
                          "null padding region ended '.sff' which could "
                          "be the start of a concatenated SFF file? "
                          "See offset %i" % (padding, offset))
+    if padding and not extra:
+        #TODO - Is this error harmless enough to just ignore?
+        import warnings
+        from Bio import BiopythonParserWarning
+        warnings.warn("Your SFF file is technically invalid as it is missing "
+                      "a terminal %i byte null padding region." % padding,
+                      BiopythonParserWarning)
+        return
     if extra.count(_null) != padding:
         import warnings
         from Bio import BiopythonParserWarning
         warnings.warn("Your SFF file is invalid, post index %i byte "
-                      "null padding region contained data." % padding,
-                      BiopythonParserWarning)
+                      "null padding region contained data: %r"
+                      % (padding, extra), BiopythonParserWarning)
 
     offset = handle.tell()
     assert offset % 8 == 0, \



1.1                  sci-biology/biopython/files/SffIO_error_in_check_eof.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/biopython/files/SffIO_error_in_check_eof.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-biology/biopython/files/SffIO_error_in_check_eof.patch?rev=1.1&content-type=text/plain

Index: SffIO_error_in_check_eof.patch
===================================================================
diff --git a/Bio/SeqIO/SffIO.py b/Bio/SeqIO/SffIO.py
index 2bb0dac..735d55b 100644
--- a/Bio/SeqIO/SffIO.py
+++ b/Bio/SeqIO/SffIO.py
@@ -941,7 +941,8 @@ def _check_eof(handle, index_offset, index_length):
                       BiopythonParserWarning)
 
     offset = handle.tell()
-    assert offset % 8 == 0
+    assert offset % 8 == 0, \
+        "Wanted offset %i %% 8 = %i to be zero" % (offset, offset % 8)
     # Should now be at the end of the file...
     extra = handle.read(4)
     if extra == _sff:




Reply via email to