Skip to content

Commit d58509c

Browse files
authored
Merge pull request #1098 from Parallel-in-Time/copilot/fix-pipeline-error-june
Normalize malformed DOI month fields in bibbot ingestion
2 parents 706acd8 + 1c6733a commit d58509c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

bin/issue_to_bibtex.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@
149149
bib = re.sub(r'(@[a-z]*{)(.*?),', r'\1' + id + ',', bib)
150150
url_bad = re.search(r'url\s*=\s*{(.*)}', bib).groups()[0]
151151
bib = re.sub(r'(url\s*=\s*{)(.*)}', r'\1' + urllib.parse.unquote(url_bad) + '}', bib)
152+
bib = re.sub(
153+
r'(^\s*month\s*=\s*)(?:[\'"]?)([A-Za-z]+)(?:[\'"]?)\s*,',
154+
r'\1{\2},',
155+
bib,
156+
flags=re.MULTILINE,
157+
)
152158
bib_db = bibtexparser.loads(bib)
153159
print(bib)
154160
else:

0 commit comments

Comments
 (0)