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.6Assignee: Karolina Surma <ksurma>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: 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    

Description Miro Hrončok 2022-01-10 09:58:28 UTC
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

Comment 1 Petr Viktorin (pviktori) 2022-01-10 10:06:25 UTC
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

Comment 2 Victor Stinner 2022-01-10 12:15:42 UTC
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

Comment 4 Fedora Update System 2022-01-25 10:58:28 UTC
FEDORA-2022-b0c84e7430 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b0c84e7430

Comment 5 Fedora Update System 2022-01-25 11:01:33 UTC
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.

Comment 6 Fedora Update System 2022-01-25 11:46:12 UTC
FEDORA-2022-dce85ff0dc has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-dce85ff0dc

Comment 7 Fedora Update System 2022-01-25 11:49:37 UTC
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.