From 7a7b7c04492d02c9b177949d916b9eaf40e592c6 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 16 Nov 2023 11:22:35 -0500 Subject: [PATCH] Fixed crash due to multiple slashes in titles. --- HISTORY.rst | 4 ++++ read_structure_step/formats/sdf/sdf.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2d8c18b..5092484 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,10 @@ ======= History ======= +2023.11.16 -- Bugfix: titles in SDF files + * Crashed reading some SDF files write by SEAMM due to the system and configuration + names encoded in the title having multiple slashes (/). + 2023.11.5 -- Added writers for CIF and mmCIF. 2023.11.2 -- Initial changes to structure handling diff --git a/read_structure_step/formats/sdf/sdf.py b/read_structure_step/formats/sdf/sdf.py index 1859598..c21baba 100644 --- a/read_structure_step/formats/sdf/sdf.py +++ b/read_structure_step/formats/sdf/sdf.py @@ -200,7 +200,7 @@ def load_sdf( if "SEAMM=" in title: for tmp in title.split("|"): if "SEAMM=" in tmp and "/" in tmp: - sysname, confname = tmp.split("=", 1)[1].split("/") + sysname, confname = tmp.split("=", 1)[1].split("/", 1) sysname = sysname.strip() confname = confname.strip() have_sysname = True