Bug 1717657 - future fails to build with Python 3.8
Summary: future fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: future
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Antonio T. (sagitter)
QA Contact: Fedora Extras Quality Assurance
URL: https://copr.fedorainfracloud.org/cop...
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-06-05 21:44 UTC by Miro Hrončok
Modified: 2019-07-10 14:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-10 14:34:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github PythonCharmers python-future issues 474 0 None open BuiltinTest.test_pow fails with Python-3.8 2020-02-15 11:09:22 UTC

Description Miro Hrončok 2019-06-05 21:44:16 UTC
future fails to build with Python 3.8.0b1. See https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/future/ for actual logs. This report is automated and not very verbose, but I'll get back here with details.

Comment 1 Miro Hrončok 2019-06-05 21:49:32 UTC
There's one failed test:


=================================== FAILURES ===================================
_____________________________ BuiltinTest.test_pow _____________________________

self = <test_future.test_builtins.BuiltinTest testMethod=test_pow>

    def test_pow(self):
        self.assertEqual(pow(0,0), 1)
        self.assertEqual(pow(0,1), 0)
        self.assertEqual(pow(1,0), 1)
        self.assertEqual(pow(1,1), 1)
    
        self.assertEqual(pow(2,0), 1)
        self.assertEqual(pow(2,10), 1024)
        self.assertEqual(pow(2,20), 1024*1024)
        self.assertEqual(pow(2,30), 1024*1024*1024)
    
        self.assertEqual(pow(-2,0), 1)
        self.assertEqual(pow(-2,1), -2)
        self.assertEqual(pow(-2,2), 4)
        self.assertEqual(pow(-2,3), -8)
    
        self.assertAlmostEqual(pow(0.,0), 1.)
        self.assertAlmostEqual(pow(0.,1), 0.)
        self.assertAlmostEqual(pow(1.,0), 1.)
        self.assertAlmostEqual(pow(1.,1), 1.)
    
        self.assertAlmostEqual(pow(2.,0), 1.)
        self.assertAlmostEqual(pow(2.,10), 1024.)
        self.assertAlmostEqual(pow(2.,20), 1024.*1024.)
        self.assertAlmostEqual(pow(2.,30), 1024.*1024.*1024.)
    
        self.assertAlmostEqual(pow(-2.,0), 1.)
        self.assertAlmostEqual(pow(-2.,1), -2.)
        self.assertAlmostEqual(pow(-2.,2), 4.)
        self.assertAlmostEqual(pow(-2.,3), -8.)
    
        for x in 2, int(2), 2.0:
            for y in 10, int(10), 10.0:
                for z in 1000, int(1000), 1000.0:
                    if isinstance(x, float) or \
                       isinstance(y, float) or \
                       isinstance(z, float):
                        self.assertRaises(TypeError, pow, x, y, z)
                    else:
                        self.assertAlmostEqual(pow(x, y, z), 24.0)
    
        self.assertAlmostEqual(pow(-1, 0.5), 1j)
        self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
    
        # Raises TypeError in Python < v3.5, ValueError in v3.5:
>       self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
E       AssertionError: (<class 'TypeError'>, <class 'ValueError'>) not raised by pow

tests/test_future/test_builtins.py:1289: AssertionError

Comment 2 Miro Hrončok 2019-06-05 21:50:34 UTC
$ python3.7
Python 3.7.3 (default, May 11 2019, 00:38:04) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> pow(-1, -2, 3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: pow() 2nd argument cannot be negative when 3rd argument specified
>>> 

$ python3.8
Python 3.8.0b1 (default, Jun  5 2019, 14:47:51) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> pow(-1, -2, 3)
1
>>>

Comment 3 Miro Hrončok 2019-06-10 07:42:16 UTC
https://docs.python.org/3.8/library/functions.html#pow

Changed in version 3.8: For int operands, the three-argument form of pow now allows the second argument to be negative, permitting computation of modular inverses.

Comment 5 Miro Hrončok 2019-06-10 07:43:53 UTC
Upstream is notified, let's deselect the test for now?


Note You need to log in before you can comment on or make changes to this bug.