| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
is_identical() iterated the internal _messages keys, which for context-specific messages are (msgid, msgctxt) tuples, but resolved them through get(), whose _key_for() collapses a tuple id to just the msgid. The lookup therefore always missed context-specific messages and the method returned False, making pybabel update --check report any catalog containing a msgctxt as out of date on every run. Look up the internal keys directly instead of round-tripping through get().
| Back | FazBrowse Home | New Git URL |
Summary
Catalog.is_identical() returned False for any catalog containing a context-specific message, even when compared with itself, so pybabel update --check reported such catalogs as out of date on every run. The internal (msgid, msgctxt) keys were resolved through get(), which strips the context and looks the message up by msgid only. The lookup now uses the internal keys directly.
Testing
Reproduced on master: a catalog with one pgettext-style message returned False from is_identical(cat). Added catalog tests covering self-comparison, equal catalogs, differing context, differing string and context-free cases; the context test fails without the fix. Full suite: 7828 passed with only two pre-existing timezone-name failures identical on a clean tree.
Checklist