Bug 2038843
| Summary: | python2.7 and python3.6 fails to build on i686: test_turtle [test_distance (test.test_turtle.TestVec2D)] fails | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
| Component: | python3.6 | Assignee: | Karolina Surma <ksurma> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | cstratak, ksurma, mhroncok, pviktori, python-maint, python-sig, torsava, vstinner |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | python3.6-3.6.15-6.fc36 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-01-25 11:01:33 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1992484 | ||
Looks like these should use assertAlmostEqual (even in the newer versions, if it's not the case there). https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertAlmostEqual Right, Python 3.11 uses assertAlmostEqual() since July 2021 (it's a recent change):
def test_distance(self):
self.assertEqual(abs(Vec2D(6, 8)), 10)
self.assertEqual(abs(Vec2D(0, 0)), 0)
self.assertAlmostEqual(abs(Vec2D(2.5, 6)), 6.5)
See:
* https://github.com/python/cpython/commit/3f135c073a53793ec68902f6b513934ddff47235
* https://bugs.python.org/issue44734
Downstream PR's to the affected Python version: https://src.fedoraproject.org/rpms/python2.7/pull-request/24 https://src.fedoraproject.org/rpms/python3.6/pull-request/38 Fedora-Python patch PR's: https://github.com/fedora-python/cpython/pull/29 https://github.com/fedora-python/cpython/pull/28 FEDORA-2022-b0c84e7430 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b0c84e7430 FEDORA-2022-b0c84e7430 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2022-dce85ff0dc has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-dce85ff0dc FEDORA-2022-dce85ff0dc has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report. |
Description of problem: During an unrelated coordinated Rawhide rebuild, I've noticed python2.7 and python3.6 fail to build on i686 with a precision-related? bug: ====================================================================== FAIL: test_distance (test.test_turtle.TestVec2D) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.18/Lib/test/test_turtle.py", line 220, in test_distance self.assertEqual(abs(vec), expected) AssertionError: 9.999999999999998 != 10 ---------------------------------------------------------------------- ====================================================================== FAIL: test_distance (test.test_turtle.TestVec2D) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.6.15/Lib/test/test_turtle.py", line 223, in test_distance self.assertEqual(abs(vec), expected) AssertionError: 9.999999999999998 != 10 ---------------------------------------------------------------------- Funnily enough, at least python3.6 succeeds on armv7hl. python2.7: https://koji.fedoraproject.org/koji/taskinfo?taskID=80997420 python3.6: https://koji.fedoraproject.org/koji/taskinfo?taskID=80997409