Skip to content

Commit

Permalink
Merge pull request #121 from HobnobMancer/patch-incomplete-read
Browse files Browse the repository at this point in the history
Catch incomplete read error
  • Loading branch information
HobnobMancer committed Jan 23, 2024
2 parents 0d603a8 + 70e1fba commit c8b07ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cazy_webscraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
from cazy_webscraper.sql import sql_orm


__version__ = "2.3.0.1"
__version__ = "2.3.0.2"


VERSION_INFO = f"cazy_webscraper version: {__version__}"
Expand Down
5 changes: 4 additions & 1 deletion cazy_webscraper/ncbi/taxonomy/multiple_taxa.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@

import logging

from http.client import IncompleteRead

from Bio.Entrez.Parser import NotXMLError
from saintBioutils.genbank import entrez_retry
from saintBioutils.misc import get_chunks_list
from tqdm import tqdm
Expand Down Expand Up @@ -201,7 +204,7 @@ def get_ncbi_tax(epost_results, cazy_data, replaced_taxa_logger, args):
protein_records = Entrez.read(record_handle, validate=False)

# if no record is returned from call to Entrez
except (TypeError, AttributeError) as error:
except (TypeError, AttributeError, RuntimeError, NotXMLError, IncompleteRead) as error:
logger.error(
f"Entrez failed to retireve accession numbers."
"Exiting retrieval of accession numbers, and returning null value 'NA'"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

setuptools.setup(
name="cazy_webscraper",
version="2.3.0.1",
version="2.3.0.2",
# Metadata
author="Emma E. M. Hobbs",
author_email="eemh1@st-andrews.ac.uk",
Expand Down

0 comments on commit c8b07ef

Please sign in to comment.