One function

homogeneize_latex_encoding in sciunto-org/python-bibtexparser

The author described this change as FIX: partially solve #4. It counts as a record because the check below fails on the code as it stood at 8144c33d4 and passes on 5caa06037, with nothing else changed between the two runs.

Fix saved2014-04-26
Sharing licenceMIT · LICENSE
Change size+4 3

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

Homogeneize the latex enconding style for bibtex This function is experimental. :param record: the record. :type record: dict :returns: dict -- the modified record.

The change

1212 record = convert_to_unicode(record)
1313 # And then, we fall back
1414 for val in record:
15- record[val] = string_to_latex(record[val])
16- if val == 'title':
17- record[val] = protect_uppercase(record[val])
15+ if val not in ('id',):
16+ record[val] = string_to_latex(record[val])
17+ if val == 'title':
18+ record[val] = protect_uppercase(record[val])
1819 return record

The check that tells the two apart

failpass·bibtexparser/tests/test_bibtexparser.py::TestBibtexParserList::test_encoding

Check file bibtexparser/tests/test_bibtexparser.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 it8144c33d4447d76eac1158e853ac65e311f51a37
Broken version dated2014-04-26
Modulebibtexparser.customization
Units changedhomogeneize_latex_encoding
Fingerprint4d9384c616ca4334
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