Code review - Issue 3340041: #2504: Add gettext.pgettext and friendshttps://codereview.appspot.com/2015-04-14T15:24:19+00:00rietveld
Message from unknown
2010-11-26T23:11:53+00:00merwokurn:md5:e95c1903600283dd7ea19892278de895
Message from andrew.kuchling@gmail.com
2015-04-14T15:24:19+00:00andrew.kuchlingurn:md5:4e60c251ed574edbbaf175495fab680c
The patch looks generally fine to me.
https://codereview.appspot.com/3340041/diff/1/Lib/gettext.py
File Lib/gettext.py (right):
https://codereview.appspot.com/3340041/diff/1/Lib/gettext.py#newcode383
Lib/gettext.py:383: except KeyError:
To minimize the risk of hiding unrelated KeyErrors, should the 'if self._output_charset ... return tmsg' lines be moved outside of the 'try' block and put into an 'else' clause?
https://codereview.appspot.com/3340041/diff/1/Lib/test/test_gettext.py
File Lib/test/test_gettext.py (right):
https://codereview.appspot.com/3340041/diff/1/Lib/test/test_gettext.py#newcode102
Lib/test/test_gettext.py:102: def test_some_translations_with_context(self):
The test suite modifications don't seem to exercise all of the variants introduced by the patch, e.g. lpgettext, npgettext, lnpgettext, ldnpgettext.