-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
msgfmt.py
: Test validity of generated file
#131853
Labels
Comments
This comment has been minimized.
This comment has been minimized.
We already have some binary MO files checked in as part of the snapshot tests, but an explicit test for the header would be nice 👍 |
serhiy-storchaka
pushed a commit
that referenced
this issue
Mar 29, 2025
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Mar 29, 2025
Use a generated .mo file instead of a checked in one.
serhiy-storchaka
added a commit
that referenced
this issue
Mar 29, 2025
Use a generated .mo file instead of a checked in one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 - magic number
0000 0000 - version
0900 0000 - # of entries
1c00 0000 - start of key index
6400 0000 - size of value table
0000 0000 - size of hash table
0000 0000 - offset of hash table
We 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 ongettext
.Testing the last four will result in errors with a
msgfmt.c
generatedgeneral.mo
asmsgfmt.c
generates a hash table (this will change soon I hope as we will too #131725 :-) so I think we should just test the first 3 for now and test the rest later.I will send a pr
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
msgfmt
generated file #131854The text was updated successfully, but these errors were encountered: