From a1b1f8d7e9f07aae262d9340e8e73edeed81e70c Mon Sep 17 00:00:00 2001 From: Art Rhyno Date: Sat, 16 Jun 2012 19:51:12 -0400 Subject: [PATCH] fix for xmlmarc records with empty fields --- conifer/libsystems/marcxml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conifer/libsystems/marcxml.py b/conifer/libsystems/marcxml.py index 0f828a1..9cfb4e4 100644 --- a/conifer/libsystems/marcxml.py +++ b/conifer/libsystems/marcxml.py @@ -28,7 +28,8 @@ def record_to_dictionary(rec, multiples=True): dct = {} for cf in tree.findall('{http://www.loc.gov/MARC21/slim}controlfield'): t = cf.attrib['tag'] - dct.setdefault(t, []).append(cf.text) + if not cf.text is None: + dct.setdefault(t, []).append(cf.text) for df in tree.findall('{http://www.loc.gov/MARC21/slim}datafield'): t = df.attrib['tag'] for sf in df.findall('{http://www.loc.gov/MARC21/slim}subfield'): -- 2.11.0