One function

keyword in sciunto-org/python-bibtexparser

The author described this change as Fix #8, support both , and ; in keyword spliter. It counts as a record because the check below fails on the code as it stood at 6c666004f and passes on b7343f041, with nothing else changed between the two runs.

Fix saved2013-11-11
Sharing licenceMIT · LICENSE
Change size+4 2

What the code was meant to do, written into the code itself as a docstring

Split keyword field into a list. :param record: the record. :type record: dict :returns: dict -- the modified record.

The change

1-def keyword(record):
1+def keyword(record, sep=',|;'):
22 """
33 Split keyword field into a list.
44
55 :param record: the record.
66 :type record: dict
7+ :param sep: pattern used for the splitting regexp.
8+ :type record: string, optional
79 :returns: dict -- the modified record.
810
911 """
1012 if "keyword" in record:
11- record["keyword"] = [i.strip() for i in record["keyword"].replace('\n', '').split(",")]
13+ record["keyword"] = [i.strip() for i in re.split(sep, record["keyword"].replace('\n', ''))]
1214
1315 return record

The check that tells the two apart

failpass·bibtexparser/tests/test_customization.py::TestBibtexParserMethod::test_keywords

Check file bibtexparser/tests/test_customization.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it6c666004f85ebbc350d5cedee6438c179b7a8923
Broken version dated2013-11-03
Modulebibtexparser.customization
Units changedkeyword
Fingerprint8aaeb591b94ce618
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in sciunto-org/python-bibtexparser