https://github.com/python/cpython/commit/c6b1a073438d93d4e62957accc73487df6711851
commit: c6b1a073438d93d4e62957accc73487df6711851
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2025-03-29T19:14:37+02:00
summary:
gh-131853: Fix test_msgfmt on big-endian platforms (GH-131879)
Use a generated .mo file instead of a checked in one.
files:
M Lib/test/test_tools/test_msgfmt.py
diff --git a/Lib/test/test_tools/test_msgfmt.py
b/Lib/test/test_tools/test_msgfmt.py
index dafac0562f472d..ea10d4693df75a 100644
--- a/Lib/test/test_tools/test_msgfmt.py
+++ b/Lib/test/test_tools/test_msgfmt.py
@@ -42,8 +42,11 @@ def test_compilation(self):
self.assertDictEqual(actual._catalog, expected._catalog)
def test_binary_header(self):
- with open(data_dir / "general.mo", "rb") as f:
- mo_data = f.read()
+ with temp_cwd():
+ tmp_mo_file = 'messages.mo'
+ compile_messages(data_dir / "general.po", tmp_mo_file)
+ with open(tmp_mo_file, 'rb') as f:
+ mo_data = f.read()
(
magic,
@@ -53,7 +56,7 @@ def test_binary_header(self):
trans_table_offset,
hash_table_size,
hash_table_offset,
- ) = struct.unpack("=Iiiiiii", mo_data[:28])
+ ) = struct.unpack("=7I", mo_data[:28])
self.assertEqual(magic, 0x950412de)
self.assertEqual(version, 0)
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]