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
{{ message }}
Repository navigation
Incorrect handling for msgctxt in msgfmt.py #85012
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2020-05-31.20:56:52.559>labels= ['type-bug', '3.8']
title='Incorrect handling for msgctxt in msgfmt.py'updated_at=<Date2020-05-31.21:16:05.371>user='https://github.com/da1910'
Running msgfmt.py with the attached po file will produce an incorrect context for the entry "test".
Looking at the script, we require a comment to follow a contexted section for the context to be cleared. The gettext documentation makes clear that all comments are optional, so this is not desired behaviour.
My reading of the gettext documentation has a "msgctxt" line applying only to the current entry, so it should be cleared once the last msgstr has been written for that entry.
I will endeavour to provide a patch within the next day or two.
Activity
da1910 commentedon May 31, 2020
Running msgfmt.py with the attached po file will produce an incorrect context for the entry "test".
Looking at the script, we require a comment to follow a contexted section for the context to be cleared. The gettext documentation makes clear that all comments are optional, so this is not desired behaviour.
My reading of the gettext documentation has a "msgctxt" line applying only to the current entry, so it should be cleared once the last msgstr has been written for that entry.
I will endeavour to provide a patch within the next day or two.
da1910 commentedon May 31, 2020
Test po file included
da1910 commentedon May 31, 2020
And a patch:
After the end of a message entry the options for the next line are:
m-aciek commentedon Dec 8, 2023
Does
msgfmt.pyhave its test suite? It would be worth to add also a regression test there.tomasr8 commentedon Dec 8, 2023
There is
Lib/test/test_tools/test_i18n.pyfor pygettext but no tests for msgfmt as far as I'm awaregh-85012: Properly reset msgctxt when compiling messages with msgfmt (G…
[3.13] pythongh-85012: Properly reset msgctxt when compiling messages…
[3.12] pythongh-85012: Properly reset msgctxt when compiling messages…
[3.12] gh-85012: Properly reset msgctxt when compiling messages with …
[3.13] gh-85012: Properly reset msgctxt when compiling messages with …
[3.12] pythongh-85012: Properly reset msgctxt when compiling messages…
pythongh-85012: Properly reset msgctxt when compiling messages with m…