1. David Jean Louis
  2. polib
  3. Issues
Issue #38 resolved

POFile.append() raise a duplicate exception when you try to add a new entry with the same msgid and a different msgctxt

Sorin Sbarnea
created an issue

POFile.append() raise a duplicate exception when you try to add a new entry with the same msgid and a different msgctxt.

The PO specification says clearly: the unique key is (msgid, msgctxt) - it is perfectly valid to have duplicate msigid entries as long they have different msgctxt.

Note, this happens only when you enable check for duplicates, so here is the bug.

Comments (4)

  1. David Jean Louis repo owner

    This is certainly not the default beahvior, you must have set check_for_duplicates explicitely to True, no ?

    That said, you are right, even with check_for_duplicates set to True, polib shouldn't raise an error if the msgctxt is different.

  2. Log in to comment