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=',|;'): | |
| 2 | 2 | """ | |
| 3 | 3 | Split keyword field into a list. | |
| 4 | 4 | ||
| 5 | 5 | :param record: the record. | |
| 6 | 6 | :type record: dict | |
| 7 | + | :param sep: pattern used for the splitting regexp. | |
| 8 | + | :type record: string, optional | |
| 7 | 9 | :returns: dict -- the modified record. | |
| 8 | 10 | ||
| 9 | 11 | """ | |
| 10 | 12 | 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', ''))] | |
| 12 | 14 | ||
| 13 | 15 | return record |
The check that tells the two apart
fail→pass·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
- 2014-04-26homogeneize_latex_encoding
- 2013-09-29getnames