diff --git a/src/biocommons/seqrepo/fastadir/fastadir.py b/src/biocommons/seqrepo/fastadir/fastadir.py index 1336a3c..aa330a8 100644 --- a/src/biocommons/seqrepo/fastadir/fastadir.py +++ b/src/biocommons/seqrepo/fastadir/fastadir.py @@ -190,7 +190,7 @@ def store(self, seq_id: str, seq: str) -> str: # <------ dir_ -----> # <----------- path -----------> if self._writing is None: - reldir = datetime.datetime.utcnow().strftime("%Y/%m%d/%H%M") + reldir = datetime.datetime.now(datetime.timezone.utc).strftime("%Y/%m%d/%H%M") basename = str(time.time()) + ".fa.bgz" relpath = os.path.join(reldir, basename) diff --git a/src/biocommons/seqrepo/seqaliasdb/seqaliasdb.py b/src/biocommons/seqrepo/seqaliasdb/seqaliasdb.py index 2a26ba8..5747b35 100644 --- a/src/biocommons/seqrepo/seqaliasdb/seqaliasdb.py +++ b/src/biocommons/seqrepo/seqaliasdb/seqaliasdb.py @@ -1,3 +1,4 @@ +import datetime import logging import sqlite3 from importlib import resources @@ -22,6 +23,9 @@ raise ImportError(msg) +sqlite3.register_converter("timestamp", lambda val: datetime.datetime.fromisoformat(val.decode())) + + class SeqAliasDB(object): """Implements a sqlite database of sequence aliases"""