From 9feae862ed5542d3b74684d818854e4fda7b3ca5 Mon Sep 17 00:00:00 2001 From: Pez Cuckow Date: Fri, 8 Oct 2021 09:20:59 +0200 Subject: [PATCH] Explicitly rejoin filter list to a string --- biblatex_check.py | 2 +- tests/input.bib | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/biblatex_check.py b/biblatex_check.py index cf23586..4b2b66f 100755 --- a/biblatex_check.py +++ b/biblatex_check.py @@ -389,7 +389,7 @@ def handleEntryField(lineNumber, line): # Checks per field type if fieldName == "author": - entryAuthor = filter(lambda x: not (x in '\\"{}'), fieldValue.split(" and ")[0]) + entryAuthor = "".join(filter(lambda x: not (x in '\\"{}'), fieldValue.split(" and ")[0])) for author in fieldValue.split(" and "): comp = author.split(",") if len(comp) == 0: diff --git a/tests/input.bib b/tests/input.bib index 42eb346..aae9ecf 100644 --- a/tests/input.bib +++ b/tests/input.bib @@ -1,5 +1,5 @@ % This file should fail with the commented errors -% 14 errors expected +% 15 errors expected % "misc": ["author/editor", "title", "year/date"] % year/date missing @@ -95,4 +95,13 @@ @report{bibLatexChecker address={Address is an alias fro location}, type = {Website}, year = {2014}, -} \ No newline at end of file +} + +% "book": ["author", "title", "year/date"], +% Capitals handled, and no errors in author field +% year/date field missing +@book {hartshorne1977algebraic, + AUTHOR = {Hartshorne R}, + TITLE = {Algebraic geometry}, + NOTE = {Graduate Texts in Mathematics, No. 52}, +}