gh-145633: Fix struct.pack('f') on s390x#146422
Conversation
Use PyFloat_Pack4() to raise OverflowError. Add more tests on packing/unpacking floats.
|
@skirpichev: Would you mind to review this change? |
skirpichev
left a comment
There was a problem hiding this comment.
(Sorry, I forgot to submit review yesterday.)
Looks ok, but maybe we should rather keep test_705836(), just with a small addition in the end.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
!buildbot s390x Fedora Stable |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit ce1093b 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146422%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
!buildbot SPARCv9 Oracle Solaris 11.4 PR |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit ce1093b 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146422%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
On Wed, Mar 25, 2026 at 06:26:38PM -0700, Victor Stinner wrote:
Even if there are tests on the C
API, I would prefer explicit tests on the struct module.
Then lets test also half-floats here.
|
|
Hi, the SPARC buildbot is unfortunately still not 100% there, but the ======================================================================
FAIL: test_705836 (test.test_struct.StructTest.test_705836)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builds/pythonmain/cpython-main/Lib/test/test_struct.py", line 399, in test_705836
self.assertRaises(OverflowError, struct.pack, ">f", big)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: OverflowError not raised by packand passes with it. Thanks! |
|
I added again |
|
!buildbot s390x Fedora Stable PR |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit d4e1edf 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146422%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
"macOS / build and test (macos-26-intel)": test_tkinter failed with a timeout: I re-ran this job. |
|
"buildbot/s390x Fedora Stable PR": the new test_struct passed successfully! |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Use PyFloat_Pack4() to raise OverflowError. Add more tests on packing/unpacking floats. (cherry picked from commit 8de70b3) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
Sorry, @vstinner, I could not cleanly backport this to |
|
GH-146460 is a backport of this pull request to the 3.14 branch. |
|
GH-146461 is a backport of this pull request to the 3.13 branch. |
|
I merged my PR. Thanks for the review @skirpichev. |
Use PyFloat_Pack4() to raise OverflowError.
Add more tests on packing/unpacking floats.