classification
Title: msgfmt.py generates invalid mo because msgfmt.make() does not clear dictionary
Type: behavior Stage: test needed
Components: Demos and Tools Versions: Python 3.3, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, loewis, timothy.ty.lee
Priority: normal Keywords: needs review, patch

Created on 2010-09-02 14:31 by timothy.ty.lee, last changed 2011-06-15 14:00 by eric.araujo.

Files
File name Uploaded Description Edit
msgfmt-clear.diff timothy.ty.lee, 2010-09-02 14:31 2 line patch to clear dictionary at start of msgfmt.make()
test_msgfmt.py timothy.ty.lee, 2011-06-15 13:47 Test program to check behaviour before and after applying the patch
test1.po timothy.ty.lee, 2011-06-15 13:49 1st of 2 .po files used by test program
test2.po timothy.ty.lee, 2011-06-15 13:49 2nd of 2 .po files used by test program
Messages (3)
msg115378 - (view) Author: Timothy Lee (timothy.ty.lee) Date: 2010-09-02 14:31
This bug can potentially lead to generation of invalid mo files when msgfmt.make() is invoked more than once.

The bug has always been present in the source code.  The included patch should be applied to all maintained branches.
msg138336 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-14 15:48
Thanks for the report and patch.  Can you write a test?
msg138372 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-15 14:00
Thanks!  In my latest message, I had forgotten that msgfmt was in Tools, not in the standard library, and as such has no automated regression tests.  Features get added and bugs get fixed after manual testing only, so I will commit your patch (modulo the unneeded global statement) without tests (but after manual testing) unless someone objects.
History
Date User Action Args
2011-06-15 14:00:31eric.araujosetassignee: eric.araujo
messages: + msg138372
2011-06-15 13:49:28timothy.ty.leesetfiles: + test2.po
2011-06-15 13:49:00timothy.ty.leesetfiles: + test1.po
2011-06-15 13:47:29timothy.ty.leesetfiles: + test_msgfmt.py
2011-06-14 15:48:05eric.araujosetversions: + Python 3.3, - Python 3.1
nosy: + eric.araujo

messages: + msg138336

stage: patch review -> test needed
2010-09-06 03:59:14r.david.murraysetnosy: + loewis
2010-09-02 19:19:19brian.curtinsetkeywords: + needs review
stage: patch review
versions: - Python 2.6, Python 2.5, Python 3.3
2010-09-02 14:31:41timothy.ty.leecreate