Title: `msgfmt.py`: Test validity of generated file · Issue #131853 · python/cpython · GitHub
Open Graph Title: `msgfmt.py`: Test validity of generated file · Issue #131853 · python/cpython
X Title: `msgfmt.py`: Test validity of generated file · Issue #131853 · python/cpython
Description: Feature or enhancement Proposal: Test the header of the binary .mo file is generated correctly and is as expected for example the start of a msgfmt.py generated file: de12 0495 0000 0000 0900 0000 1c00 0000 6400 0000 0000 0000 0000 0000 ...
Open Graph Description: Feature or enhancement Proposal: Test the header of the binary .mo file is generated correctly and is as expected for example the start of a msgfmt.py generated file: de12 0495 0000 0000 0900 0000 ...
X Description: Feature or enhancement Proposal: Test the header of the binary .mo file is generated correctly and is as expected for example the start of a msgfmt.py generated file: de12 0495 0000 0000 0900 0000 ...
Opengraph URL: https://github.com/python/cpython/issues/131853
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`msgfmt.py`: Test validity of generated file","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nTest the header of the binary .mo file is generated correctly and is as expected for example the start of a `msgfmt.py` generated file:\n\n```\nde12 0495 0000 0000 0900 0000 1c00 0000\n6400 0000 0000 0000 0000 0000 0000 0000\n```\nde12 0495 - magic number\n0000 0000 - version\n0900 0000 - # of entries\n1c00 0000 - start of key index\n6400 0000 - size of value table\n0000 0000 - size of hash table \n0000 0000 - offset of hash table\n\nWe currently do not test the structure of the `.mo` though it is partially covered as I presume the translation tests may fail but that depends on `gettext`.\n\nTesting the last four will result in errors with a `msgfmt.c` generated `general.mo` as `msgfmt.c` generates a hash table (this will change soon I hope as we will too https://github.com/python/cpython/issues/131725 :-) so I think we should just test the first 3 for now and test the rest later.\n\nI will send a pr\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-131854\n* gh-131879\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/StanFromIreland","@type":"Person","name":"StanFromIreland"},"datePublished":"2025-03-28T16:21:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/131853/cpython/issues/131853"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:77d54b83-fb05-eff2-e74f-7185afb6ff1f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1CA:A39F5:EC0023:142FFDD:696A9434 |
| html-safe-nonce | 7239b5cefb076978b30f6f72e1fbc486264e3c5525682abd7eb10a5f72979681 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUNBOkEzOUY1OkVDMDAyMzoxNDJGRkREOjY5NkE5NDM0IiwidmlzaXRvcl9pZCI6Ijg0MTUxMTMwNjk1ODU5MjkyNjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7f116815dbcc8887adb0508fb8b4cd65ff7cdd172cc16bd2b96b910585f41063 |
| hovercard-subject-tag | issue:2956609202 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/131853/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f56de2faf44635a03c77fb9753ecb852f500d73d5f07bb237a85b073d67ea070/python/cpython/issues/131853 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f56de2faf44635a03c77fb9753ecb852f500d73d5f07bb237a85b073d67ea070/python/cpython/issues/131853 |
| og:image:alt | Feature or enhancement Proposal: Test the header of the binary .mo file is generated correctly and is as expected for example the start of a msgfmt.py generated file: de12 0495 0000 0000 0900 0000 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | StanFromIreland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4dd496afc954da9c207b2d9fbe86e3074619f565754aa1d9274aec30d9e5b8d7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 31496a13b80a2f6ad77d6c617ee2255a3545b539 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width