Blob Blame History Raw
From 0baaf60f1975896d048056ca9c137e3c0036c43b Mon Sep 17 00:00:00 2001
From: Peter Cock <p.j.a.cock@googlemail.com>
Date: Thu, 28 Mar 2024 20:26:20 +0000
Subject: [PATCH 1/2] Try increasing the SeqXML parser block size

Hopefully this will fix #4640.

If it does, this is due to CPython issue 115133
and is a side effect of a CVE security fix.
---
 Bio/SeqIO/SeqXmlIO.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Bio/SeqIO/SeqXmlIO.py b/Bio/SeqIO/SeqXmlIO.py
index 4b95491c4c8..6310adbf0bc 100644
--- a/Bio/SeqIO/SeqXmlIO.py
+++ b/Bio/SeqIO/SeqXmlIO.py
@@ -441,7 +441,8 @@ class SeqXmlIterator(SequenceIterator):
     method calls.
     """
 
-    BLOCK = 1024
+    # Small block size can be a problem with libexpat 2.6.0 onwards:
+    BLOCK = 2048
 
     def __init__(self, stream_or_path, namespace=None):
         """Create the object and initialize the XML parser."""

From 7da67678299b5cc8d41fa1d667eb5054f1c13f4a Mon Sep 17 00:00:00 2001
From: Peter Cock <p.j.a.cock@googlemail.com>
Date: Fri, 29 Mar 2024 12:02:48 +0000
Subject: [PATCH 2/2] Double it again to 4k

See discussion on #4640
---
 Bio/SeqIO/SeqXmlIO.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Bio/SeqIO/SeqXmlIO.py b/Bio/SeqIO/SeqXmlIO.py
index 6310adbf0bc..8fe75ebb728 100644
--- a/Bio/SeqIO/SeqXmlIO.py
+++ b/Bio/SeqIO/SeqXmlIO.py
@@ -442,7 +442,7 @@ class SeqXmlIterator(SequenceIterator):
     """
 
     # Small block size can be a problem with libexpat 2.6.0 onwards:
-    BLOCK = 2048
+    BLOCK = 4096
 
     def __init__(self, stream_or_path, namespace=None):
         """Create the object and initialize the XML parser."""