Whole file
hannosch/python-gettext
The author described this change as “Fix plural form support under Python 3.x, closes #5.”. It counts as a record because the check below fails on the code as it stood at fd7647170 and passes on 1b2213c9a, with nothing else changed between the two runs.
Projecthannosch/python-gettext
Fix saved2016-01-04
Sharing licenceBSD-2-Clause · LICENSE.rst
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
Fix plural form support under Python 3.x, closes #5.
The change
| 235 | 235 | 'msgid on line %d of po file %s' % | |
| 236 | 236 | (lno, repr(self.name))) | |
| 237 | 237 | l = l[12:] | |
| 238 | - | msgid += b('\0') # separator of singular and plural | |
| 238 | + | msgid += u('\0') # separator of singular and plural | |
| 239 | 239 | is_plural = True | |
| 240 | 240 | # Now we are in a msgstr section | |
| 241 | 241 | elif l.startswith('msgstr'): | |
| ⋯ | |||
| 248 | 248 | l = l.split(']', 1)[1] | |
| 249 | 249 | if msgstr: | |
| 250 | 250 | # Separator of the various plural forms | |
| 251 | - | msgstr += b('\0') | |
| 251 | + | msgstr += u('\0') | |
| 252 | 252 | else: | |
| 253 | 253 | if is_plural: | |
| 254 | 254 | raise PoSyntaxError('indexed msgstr required for ' | |
The check that tells the two apart
fail→pass·pythongettext/tests/test_compile.py::TestWriter::test_plural
Check file pythongettext/tests/test_compile.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 itfd7647170f1130ce5e567720544fe819d1976d2f
Broken version dated2016-01-04
Modulepythongettext.msgfmt
Units changedMsgfmt
Fingerprint66d4cdee2785f45b
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.