-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
msgfmt.py generates invalid mo because msgfmt.make() does not clear dictionary #53950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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. |
Thanks for the report and patch. Can you write a test? |
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. |
FWIW now we have Lib/test/test_tools.py. |
Éric: do you still want to apply this patch? (I don't think any of the 'global MESSAGES' statements in msgfmt.py are necessary; none of those functions is doing 'MESSAGES = <something>', just calling methods or setting keys in the dictionary.) |
10 years later, are you still planning to apply the patch? I can open a PR with it if you want. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: