You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the last obsolete entry with that msgid remains in the file (based on their order before the last update command, and regardless of whether a message without msgctxt was present):
The above looks to only be using the msgid, rather than (msgid, msgctx), so messages with the same msgid but different msgctx will get overwritten. This seems to fix it:
if self.obsolete:
if not self.ignore_obsolete:
- self.catalog.obsolete[msgid] = message+ self.catalog.obsolete[self.catalog._key_for(msgid, msgctxt)] = message
Overview Description
When a file contains multiple obsoletes from different contexts, and they have the same ID, all but the last one will get stripped from the file.
Steps to Reproduce
msgid
but differentmsgctxt
(in arbitrary order, optionally including one without amsgctxt
as well):pybabel update
with appropriate params; the messages should be moved to the end of the file and marked obsolete:Actual Results
Only the last obsolete entry with that
msgid
remains in the file (based on their order before the last update command, and regardless of whether a message withoutmsgctxt
was present):Expected Results
The messages were from different contexts so they should all be retained.
Reproducibility
This issue appears to reproduce whenever the described situation occurs.
Additional Information
Tested on Babel version 2.16.0
The text was updated successfully, but these errors were encountered: