[3.12] gh-85012: Properly reset msgctxt when compiling messages with msgfmt (GH-130525) (GH-131206)

Add also human-readable snapshots for tests.
(cherry picked from commit 7ea6e88eb4)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
This commit is contained in:
Serhiy Storchaka 2025-03-13 21:09:42 +02:00 committed by GitHub
parent ba363894bb
commit a3f4889413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 94 additions and 0 deletions

View file

@ -149,6 +149,7 @@ def make(filename, outfile):
elif l.startswith('msgid') and not l.startswith('msgid_plural'):
if section == STR:
add(msgctxt, msgid, msgstr, fuzzy)
msgctxt = None
if not msgid:
# See whether there is an encoding declaration
p = HeaderParser()