Bug 2175152 - py-radix fails to build with Python 3.12: AttributeError: 'LoadRadixPickle' object has no attribute 'assertEquals'.
Summary: py-radix fails to build with Python 3.12: AttributeError: 'LoadRadixPickle' o...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: py-radix
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-03-03 11:22 UTC by Tomáš Hrnčiar
Modified: 2024-06-26 01:55 UTC (History)
4 users (show)

Fixed In Version: py-radix-0.10.0-11.fc40
Clone Of:
Environment:
Last Closed: 2024-06-26 01:55:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github mjschultz py-radix pull 44 0 None open Change away from deprecated assertEquals and assertNotEquals to assertEqual 2024-06-16 17:49:49 UTC

Description Tomáš Hrnčiar 2023-03-03 11:22:15 UTC
py-radix fails to build with Python 3.12.0a5.

=================================== FAILURES ===================================
_____________________ LoadRadixPickle.test_radix_0_5_c_ext _____________________

self = <tests.test_compat.LoadRadixPickle testMethod=test_radix_0_5_c_ext>

    def test_radix_0_5_c_ext(self):
>       self._check_file('radix-0.5-c_ext.pkl')

tests/test_compat.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_compat.LoadRadixPickle testMethod=test_radix_0_5_c_ext>
file_name = 'radix-0.5-c_ext.pkl'

    def _check_file(self, file_name):
        with open(join(self.data_dir, file_name), 'rb') as f:
            tree = load(f)
>       self.assertEquals(len(tree.nodes()), 3)
E       AttributeError: 'LoadRadixPickle' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_compat.py:33: AttributeError
_____________________ LoadRadixPickle.test_radix_0_6_c_ext _____________________

self = <tests.test_compat.LoadRadixPickle testMethod=test_radix_0_6_c_ext>

    def test_radix_0_6_c_ext(self):
>       self._check_file('radix-0.6-c_ext.pkl')

tests/test_compat.py:44: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_compat.LoadRadixPickle testMethod=test_radix_0_6_c_ext>
file_name = 'radix-0.6-c_ext.pkl'

    def _check_file(self, file_name):
        with open(join(self.data_dir, file_name), 'rb') as f:
            tree = load(f)
>       self.assertEquals(len(tree.nodes()), 3)
E       AttributeError: 'LoadRadixPickle' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_compat.py:33: AttributeError
____________________ LoadRadixPickle.test_radix_0_6_no_ext _____________________

self = <tests.test_compat.LoadRadixPickle testMethod=test_radix_0_6_no_ext>

    def test_radix_0_6_no_ext(self):
>       self._check_file('radix-0.6-no_ext.pkl')

tests/test_compat.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_compat.LoadRadixPickle testMethod=test_radix_0_6_no_ext>
file_name = 'radix-0.6-no_ext.pkl'

    def _check_file(self, file_name):
        with open(join(self.data_dir, file_name), 'rb') as f:
            tree = load(f)
>       self.assertEquals(len(tree.nodes()), 3)
E       AttributeError: 'LoadRadixPickle' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_compat.py:33: AttributeError
______________________ TestRadix.test_10__use_after_free _______________________

self = <tests.test_regression.TestRadix testMethod=test_10__use_after_free>

    def test_10__use_after_free(self):
        tree = radix.Radix()
        node1 = tree.add("10.0.0.0/8")
        del tree
>       self.assertEquals(node1.prefix, "10.0.0.0/8")
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:192: AttributeError
____________________ TestRadix.test_12__inconsistent_masks4 ____________________

self = <tests.test_regression.TestRadix testMethod=test_12__inconsistent_masks4>

    def test_12__inconsistent_masks4(self):
        tree = radix.Radix()
        node1 = tree.add("10.255.255.255", 28)
        node2 = tree.add(network="10.255.255.240/28")
        node3 = tree.add(network="10.255.255.252", masklen=28)
        self.assertTrue(node1 is node2)
        self.assertTrue(node1 is node3)
>       self.assertEquals(node1.prefix, "10.255.255.240/28")
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:208: AttributeError
____________________ TestRadix.test_13__inconsistent_masks6 ____________________

self = <tests.test_regression.TestRadix testMethod=test_13__inconsistent_masks6>

    def test_13__inconsistent_masks6(self):
        tree = radix.Radix()
        node1 = tree.add("dead:beef:1234:5678::", 32)
        node2 = tree.add(network="dead:beef:8888:9999::/32")
        node3 = tree.add(network="dead:beef::", masklen=32)
        self.assertTrue(node1 is node2)
        self.assertTrue(node1 is node3)
>       self.assertEquals(node1.prefix, "dead:beef::/32")
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:217: AttributeError
_____________________ TestRadix.test_14__packed_addresses4 _____________________

self = <tests.test_regression.TestRadix testMethod=test_14__packed_addresses4>

    def test_14__packed_addresses4(self):
        tree = radix.Radix()
        p = struct.pack('4B', 0xe0, 0x14, 0x0b, 0x40)
        node = tree.add(packed=p, masklen=26)
>       self.assertEquals(node.family, socket.AF_INET)
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:223: AttributeError
_____________________ TestRadix.test_15__packed_addresses6 _____________________

self = <tests.test_regression.TestRadix testMethod=test_15__packed_addresses6>

    def test_15__packed_addresses6(self):
        tree = radix.Radix()
        p = struct.pack(
            '16B',
            0xde, 0xad, 0xbe, 0xef, 0x12, 0x34, 0x56, 0x78,
            0x9a, 0xbc, 0xde, 0xf0, 0x00, 0x00, 0x00, 0x00)
        node = tree.add(packed=p, masklen=108)
>       self.assertEquals(node.family, socket.AF_INET6)
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:234: AttributeError
_______________________ TestRadix.test_16__bad_addresses _______________________

self = <tests.test_regression.TestRadix testMethod=test_16__bad_addresses>

    def test_16__bad_addresses(self):
        tree = radix.Radix()
        self.assertRaises(TypeError, tree.add)
        self.assertRaises(ValueError, tree.add, "blah/32")
        self.assertRaises(ValueError, tree.add, "blah", 32)
        self.assertRaises(ValueError, tree.add, "127.0.0.1", -2)
        self.assertRaises(ValueError, tree.add, "127.0.0.1", 64)
        self.assertRaises(ValueError, tree.add, "::", -2)
        self.assertRaises(ValueError, tree.add, "::", 256)
>       self.assertEquals(len(tree.nodes()), 0)
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:249: AttributeError
___________________ TestRadix.test_17__mixed_address_family ____________________

self = <tests.test_regression.TestRadix testMethod=test_17__mixed_address_family>

    def test_17__mixed_address_family(self):
        tree = radix.Radix()
        node1 = tree.add("255.255.255.255", 32)
        node2 = tree.add("ffff::/32")
        node1_o = tree.search_best("255.255.255.255")
        node2_o = tree.search_best("ffff::")
        self.assertTrue(node1 is node1_o)
        self.assertTrue(node2 is node2_o)
>       self.assertNotEquals(node1.prefix, node2.prefix)
E       AttributeError: 'TestRadix' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?

tests/test_regression.py:259: AttributeError
_____________________ TestRadix.test_21__lots_of_prefixes ______________________

self = <tests.test_regression.TestRadix testMethod=test_21__lots_of_prefixes>

    def test_21__lots_of_prefixes(self):
        tree = radix.Radix()
        num_nodes_in = 0
        for i in range(0, 128):
            for j in range(0, 128):
                k = ((i + j) % 8) + 24
                node = tree.add("1.%d.%d.0" % (i, j), k)
                node.data["i"] = i
                node.data["j"] = j
                num_nodes_in += 1
    
        num_nodes_del = 0
        for i in range(0, 128, 5):
            for j in range(0, 128, 3):
                k = ((i + j) % 8) + 24
                tree.delete("1.%d.%d.0" % (i, j), k)
                num_nodes_del += 1
    
        num_nodes_out = 0
        for node in tree:
            i = node.data["i"]
            j = node.data["j"]
            k = ((i + j) % 8) + 24
            prefix = "1.%d.%d.0/%d" % (i, j, k)
>           self.assertEquals(node.prefix, prefix)
E           AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:324: AttributeError
__________________________ TestRadix.test_21__pickle ___________________________

self = <tests.test_regression.TestRadix testMethod=test_21__pickle>

    def test_21__pickle(self):
        tree = radix.Radix()
        num_nodes_in = 0
        for i in range(0, 128):
            for j in range(0, 128):
                k = ((i + j) % 8) + 24
                addr = "1.%d.%d.0" % (i, j)
                node = tree.add(addr, k)
                node.data["i"] = i
                node.data["j"] = j
                num_nodes_in += 1
        tree_pickled = pickle.dumps(tree)
        del tree
        tree2 = pickle.loads(tree_pickled)
        for i in range(0, 128):
            for j in range(0, 128):
                k = ((i + j) % 8) + 24
                addr = "1.%d.%d.0" % (i, j)
                node = tree2.search_exact(addr, k)
>               self.assertNotEquals(node, None)
E               AttributeError: 'TestRadix' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?

tests/test_regression.py:356: AttributeError
______________________ TestRadix.test_22__broken_sanitise ______________________

self = <tests.test_regression.TestRadix testMethod=test_22__broken_sanitise>

    def test_22__broken_sanitise(self):
        tree = radix.Radix()
        node = tree.add("255.255.255.255/15")
>       self.assertEquals(node.prefix, "255.254.0.0/15")
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:335: AttributeError
________________________ TestRadix.test_22_search_best _________________________

self = <tests.test_regression.TestRadix testMethod=test_22_search_best>

    def test_22_search_best(self):
        tree = radix.Radix()
        tree.add('10.0.0.0/8')
        tree.add('10.0.0.0/13')
        tree.add('10.0.0.0/16')
>       self.assertEquals(
            tree.search_best('10.0.0.0/15').prefix,
            '10.0.0.0/13')
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:394: AttributeError
________________________ TestRadix.test_24_search_worst ________________________

self = <tests.test_regression.TestRadix testMethod=test_24_search_worst>

    def test_24_search_worst(self):
        tree = radix.Radix()
        tree.add('10.0.0.0/8')
        tree.add('10.0.0.0/13')
        tree.add('10.0.0.0/16')
>       self.assertEquals(
            tree.search_worst('10.0.0.0/15').prefix,
            '10.0.0.0/8')
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:412: AttributeError
_______________________ TestRadix.test_25_search_default _______________________

self = <tests.test_regression.TestRadix testMethod=test_25_search_default>

    def test_25_search_default(self):
        tree = radix.Radix()
        tree.add('192.168.30.0/24')
        tree.add('1.1.2.0/24')
        tree.add('0.0.0.0/0')
>       self.assertEquals(
            tree.search_best('10.10.10.10').prefix,
            '0.0.0.0/0')
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:424: AttributeError
_______________________ TestRadix.test_26_search_covered _______________________

self = <tests.test_regression.TestRadix testMethod=test_26_search_covered>

    def test_26_search_covered(self):
        tree = radix.Radix()
        tree.add('10.0.0.0/8')
        tree.add('10.0.0.0/13')
        tree.add('10.0.0.0/31')
        tree.add('11.0.0.0/16')
        tree.add('10.30.2.1/32')
        tree.add('10.30.2.0/25')
        tree.add('0.0.0.0/0')
>       self.assertEquals(
            [n.prefix for n in tree.search_covered('11.0.0.0/8')],
            ['11.0.0.0/16'])
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:437: AttributeError
__________________ TestRadix.test_27_search_covered_segfault ___________________

self = <tests.test_regression.TestRadix testMethod=test_27_search_covered_segfault>

    def test_27_search_covered_segfault(self):
        # the following will make py-radix 0.8 segfault
        tree = radix.Radix()
        tree.add('193.178.156.0/24')
        tree.add('193.178.157.0/24')
    
>       self.assertEquals(
            [n.prefix for n in tree.search_covered('193.178.152.0/21')],
            ['193.178.156.0/24', '193.178.157.0/24']
        )
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:468: AttributeError
______________ TestRadix.test_28_search_covered_super_node_error _______________

self = <tests.test_regression.TestRadix testMethod=test_28_search_covered_super_node_error>

    def test_28_search_covered_super_node_error(self):
        tree = radix.Radix()
        tree.add('27.0.100.0/24')
        tree.add('27.0.101.0/24')
    
>       self.assertEquals(
            [n.prefix for n in tree.search_covered('31.3.104.0/21')],
            []
        )
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:478: AttributeError
______________________ TestRadix.test_29_search_covering _______________________

self = <tests.test_regression.TestRadix testMethod=test_29_search_covering>

    def test_29_search_covering(self):
        tree = radix.Radix()
        tree.add('0.0.0.0/2')
        tree.add('8.9.0.1/32')
        tree.add('8.9.0.0/16')
        tree.add('3.178.156.0/24')
        tree.add('3.178.157.0/24')
    
>       self.assertEquals([n.prefix for n in
                           tree.search_covering('8.9.0.1/32')],
                          ['8.9.0.1/32', '8.9.0.0/16', '0.0.0.0/2'])
E       AttributeError: 'TestRadix' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

tests/test_regression.py:491: AttributeError
=========================== short test summary info ============================
FAILED tests/test_compat.py::LoadRadixPickle::test_radix_0_5_c_ext - Attribut...
FAILED tests/test_compat.py::LoadRadixPickle::test_radix_0_6_c_ext - Attribut...
FAILED tests/test_compat.py::LoadRadixPickle::test_radix_0_6_no_ext - Attribu...
FAILED tests/test_regression.py::TestRadix::test_10__use_after_free - Attribu...
FAILED tests/test_regression.py::TestRadix::test_12__inconsistent_masks4 - At...
FAILED tests/test_regression.py::TestRadix::test_13__inconsistent_masks6 - At...
FAILED tests/test_regression.py::TestRadix::test_14__packed_addresses4 - Attr...
FAILED tests/test_regression.py::TestRadix::test_15__packed_addresses6 - Attr...
FAILED tests/test_regression.py::TestRadix::test_16__bad_addresses - Attribut...
FAILED tests/test_regression.py::TestRadix::test_17__mixed_address_family - A...
FAILED tests/test_regression.py::TestRadix::test_21__lots_of_prefixes - Attri...
FAILED tests/test_regression.py::TestRadix::test_21__pickle - AttributeError:...
FAILED tests/test_regression.py::TestRadix::test_22__broken_sanitise - Attrib...
FAILED tests/test_regression.py::TestRadix::test_22_search_best - AttributeEr...
FAILED tests/test_regression.py::TestRadix::test_24_search_worst - AttributeE...
FAILED tests/test_regression.py::TestRadix::test_25_search_default - Attribut...
FAILED tests/test_regression.py::TestRadix::test_26_search_covered - Attribut...
FAILED tests/test_regression.py::TestRadix::test_27_search_covered_segfault
FAILED tests/test_regression.py::TestRadix::test_28_search_covered_super_node_error
FAILED tests/test_regression.py::TestRadix::test_29_search_covering - Attribu...
======================== 20 failed, 20 passed in 0.97s =========================

Removed many old deprecated unittest features:
- A number of TestCase method aliases:

    | Deprecated alias      |  Method Name           | Deprecated in |
    +-----------------------|------------------------|---------------+
    | failUnless            | assertTrue()           |      3.1      |
    | failIf                | assertFalse()          |      3.1      |
    | failUnlessEqual       | assertEqual()          |      3.1      |
    | failIfEqual           | assertNotEqual()       |      3.1      |
    | failUnlessAlmostEqual | assertAlmostEqual()    |      3.1      |
    | failIfAlmostEqual     | assertNotAlmostEqual() |      3.1      |
    | failUnlessRaises      | assertRaises()         |      3.1      |
    | assert_               | assertTrue()           |      3.2      |
    | assertEquals          | assertEqual()          |      3.2      |
    | assertNotEquals       | assertNotEqual()       |      3.2      |
    | assertAlmostEquals    | assertAlmostEqual()    |      3.2      |
    | assertNotAlmostEquals | assertNotAlmostEqual() |      3.2      |
    | assertRegexpMatches   | assertRegex()          |      3.2      |
    | assertRaisesRegexp    | assertRaisesRegex()    |      3.2      |
    | assertNotRegexpMatches| assertNotRegex()       |      3.5      |
    +-----------------------|------------------------|---------------+

You can use https://github.com/isidentical/teyit to automatically modernise your unit tests.
- Undocumented and broken TestCase method assertDictContainsSubset (deprecated in Python 3.2).
- Undocumented TestLoader.loadTestsFromModule parameter use_load_tests (deprecated and ignored since Python 3.2).
- An alias of the TextTestResult class: _TextTestResult (deprecated in Python 3.2).

(Contributed by Serhiy Storchaka in bpo-45162.)
https://bugs.python.org/issue?@action=redirect&bpo=45162
https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05576705-py-radix/

For all our attempts to build py-radix with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/py-radix/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Release Engineering 2023-08-16 07:10:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 2 Fedora Update System 2024-06-17 20:25:00 UTC
FEDORA-2024-f5a2f4e548 (py-radix-0.10.0-11.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f5a2f4e548

Comment 3 Fedora Update System 2024-06-18 01:37:04 UTC
FEDORA-2024-f5a2f4e548 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f5a2f4e548`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f5a2f4e548

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2024-06-26 01:55:54 UTC
FEDORA-2024-f5a2f4e548 (py-radix-0.10.0-11.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


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