[issue40835] Incorrect handling for msgctxt in msgfmt.py

2020-05-31 Thread Doug Addy


New submission from Doug Addy :

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.

--
components: Demos and Tools
messages: 370502
nosy: da1910
priority: normal
severity: normal
status: open
title: Incorrect handling for msgctxt in msgfmt.py
type: behavior
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue40835>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40835] Incorrect handling for msgctxt in msgfmt.py

2020-05-31 Thread Doug Addy


Doug Addy  added the comment:

Test po file included

--
Added file: https://bugs.python.org/file49205/test.po

___
Python tracker 
<https://bugs.python.org/issue40835>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40835] Incorrect handling for msgctxt in msgfmt.py

2020-05-31 Thread Doug Addy


Doug Addy  added the comment:

And a patch:

After the end of a message entry the options for the next line are:
1. A comment - we already reset msgctxt to None here
2. A blank line - we can have empty lines anywhere we want, so do nothing
3. A new msgctxt line - Set msgctxt to the new context
4. A msgid - This is the current failing behaviour. Fix sets msgctxt back to 
None.

--
keywords: +patch
Added file: https://bugs.python.org/file49206/40835.patch

___
Python tracker 
<https://bugs.python.org/issue40835>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com