Bug 2155244 - python-pyrad fails to build with Python 3.12: AttributeError: 'BiDictTests' object has no attribute 'assertEquals'.
Summary: python-pyrad fails to build with Python 3.12: AttributeError: 'BiDictTests' o...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyrad
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Antonio Torres
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2022-12-20 13:53 UTC by Tomáš Hrnčiar
Modified: 2023-07-12 11:02 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-07-12 11:02:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-9232 0 None None None 2022-12-20 14:02:36 UTC

Description Tomáš Hrnčiar 2022-12-20 13:53:07 UTC
python-pyrad fails to build with Python 3.12.0a3.

======================================================================
ERROR: testItemAccessor (tests.testBidict.BiDictTests.testItemAccessor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testBidict.py", line 55, in testItemAccessor
    self.assertEquals(self.bidict["shake"], "vanilla")
    ^^^^^^^^^^^^^^^^^
AttributeError: 'BiDictTests' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: testNamedParameters (tests.testClient.ConstructionTests.testNamedParameters)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 47, in testNamedParameters
    self.failUnless(client.server is self.server)
    ^^^^^^^^^^^^^^^
AttributeError: 'ConstructionTests' object has no attribute 'failUnless'

======================================================================
ERROR: testParameterOrder (tests.testClient.ConstructionTests.testParameterOrder)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 36, in testParameterOrder
    self.failUnless(client.server is self.server)
    ^^^^^^^^^^^^^^^
AttributeError: 'ConstructionTests' object has no attribute 'failUnless'

======================================================================
ERROR: testSimpleConstruction (tests.testClient.ConstructionTests.testSimpleConstruction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 25, in testSimpleConstruction
    self.failUnless(client.server is self.server)
    ^^^^^^^^^^^^^^^
AttributeError: 'ConstructionTests' object has no attribute 'failUnless'

======================================================================
ERROR: testCreateAcctPacket (tests.testClient.OtherTests.testCreateAcctPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 182, in testCreateAcctPacket
    self.failUnless(isinstance(packet, AcctPacket))
    ^^^^^^^^^^^^^^^
AttributeError: 'OtherTests' object has no attribute 'failUnless'

======================================================================
ERROR: testCreateAuthPacket (tests.testClient.OtherTests.testCreateAuthPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 175, in testCreateAuthPacket
    self.failUnless(isinstance(packet, AuthPacket))
    ^^^^^^^^^^^^^^^
AttributeError: 'OtherTests' object has no attribute 'failUnless'

======================================================================
ERROR: testAuthDelay (tests.testClient.SocketTests.testAuthDelay)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 126, in testAuthDelay
    self.failIf("Acct-Delay-Time" in packet)
    ^^^^^^^^^^^
AttributeError: 'SocketTests' object has no attribute 'failIf'. Did you mean: 'fail'?

======================================================================
ERROR: testReopen (tests.testClient.SocketTests.testReopen)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 69, in testReopen
    self.failUnless(sock is self.client._socket)
    ^^^^^^^^^^^^^^^
AttributeError: 'SocketTests' object has no attribute 'failUnless'

======================================================================
ERROR: testValidReply (tests.testClient.SocketTests.testValidReply)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testClient.py", line 157, in testValidReply
    self.failUnless(reply is packet.reply)
    ^^^^^^^^^^^^^^^
AttributeError: 'SocketTests' object has no attribute 'failUnless'

======================================================================
ERROR: testCreateAcctPacket (tests.testHost.PacketCreationTests.testCreateAcctPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testHost.py", line 47, in testCreateAcctPacket
    self.failUnless(isinstance(packet, AcctPacket))
    ^^^^^^^^^^^^^^^
AttributeError: 'PacketCreationTests' object has no attribute 'failUnless'

======================================================================
ERROR: testCreateAuthPacket (tests.testHost.PacketCreationTests.testCreateAuthPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testHost.py", line 41, in testCreateAuthPacket
    self.failUnless(isinstance(packet, AuthPacket))
    ^^^^^^^^^^^^^^^
AttributeError: 'PacketCreationTests' object has no attribute 'failUnless'

======================================================================
ERROR: testCreatePacket (tests.testHost.PacketCreationTests.testCreatePacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testHost.py", line 35, in testCreatePacket
    self.failUnless(isinstance(packet, Packet))
    ^^^^^^^^^^^^^^^
AttributeError: 'PacketCreationTests' object has no attribute 'failUnless'

======================================================================
ERROR: testSendPacket (tests.testHost.PacketSendTest.testSendPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testHost.py", line 81, in testSendPacket
    self.failUnless(self.fd.data is self.packet.packet)
    ^^^^^^^^^^^^^^^
AttributeError: 'PacketSendTest' object has no attribute 'failUnless'

======================================================================
ERROR: testSendReplyPacket (tests.testHost.PacketSendTest.testSendReplyPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testHost.py", line 86, in testSendReplyPacket
    self.failUnless(self.fd.data is self.packet.replypacket)
    ^^^^^^^^^^^^^^^
AttributeError: 'PacketSendTest' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleProxyPacketHandlesWrongPacket (tests.testProxy.ProxyPacketHandlingTests.testHandleProxyPacketHandlesWrongPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testProxy.py", line 64, in testHandleProxyPacketHandlesWrongPacket
    self.proxy._HandleProxyPacket(self.packet)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/proxy.py", line 45, in _HandleProxyPacket
    raise ServerPacketError('Received non-response on proxy socket')
pyrad.server.ServerPacketError: Received non-response on proxy socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testProxy.py", line 66, in testHandleProxyPacketHandlesWrongPacket
    self.failUnless('non-response' in str(e))
    ^^^^^^^^^^^^^^^
AttributeError: 'ProxyPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleProxyPacketUnknownHost (tests.testProxy.ProxyPacketHandlingTests.testHandleProxyPacketUnknownHost)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testProxy.py", line 51, in testHandleProxyPacketUnknownHost
    self.proxy._HandleProxyPacket(self.packet)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/proxy.py", line 40, in _HandleProxyPacket
    raise ServerPacketError('Received packet from unknown host')
pyrad.server.ServerPacketError: Received packet from unknown host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testProxy.py", line 53, in testHandleProxyPacketUnknownHost
    self.failUnless('unknown host' in str(e))
    ^^^^^^^^^^^^^^^
AttributeError: 'ProxyPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testProxyFd (tests.testProxy.SocketTests.testProxyFd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testProxy.py", line 33, in testProxyFd
    self.failUnless(isinstance(self.proxy._proxyfd, MockSocket))
    ^^^^^^^^^^^^^^^
AttributeError: 'SocketTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleAcctPacket (tests.testServer.AcctPacketHandlingTests.testHandleAcctPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 222, in testHandleAcctPacket
    self.failUnless(self.server.handled is self.packet)
    ^^^^^^^^^^^^^^^
AttributeError: 'AcctPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleAcctPacketUnknownHost (tests.testServer.AcctPacketHandlingTests.testHandleAcctPacketUnknownHost)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 200, in testHandleAcctPacketUnknownHost
    self.server._HandleAcctPacket(self.packet)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/server.py", line 233, in _HandleAcctPacket
    self._AddSecret(pkt)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/server.py", line 207, in _AddSecret
    raise ServerPacketError('Received packet from unknown host')
pyrad.server.ServerPacketError: Received packet from unknown host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 202, in testHandleAcctPacketUnknownHost
    self.failUnless('unknown host' in str(e))
    ^^^^^^^^^^^^^^^
AttributeError: 'AcctPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleAcctPacketWrongPort (tests.testServer.AcctPacketHandlingTests.testHandleAcctPacketWrongPort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 209, in testHandleAcctPacketWrongPort
    self.server._HandleAcctPacket(self.packet)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/server.py", line 236, in _HandleAcctPacket
    raise ServerPacketError(
pyrad.server.ServerPacketError: Received non-accounting packet on accounting port

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 211, in testHandleAcctPacketWrongPort
    self.failUnless('port' in str(e))
    ^^^^^^^^^^^^^^^
AttributeError: 'AcctPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleAuthPacket (tests.testServer.AuthPacketHandlingTests.testHandleAuthPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 183, in testHandleAuthPacket
    self.failUnless(self.server.handled is self.packet)
    ^^^^^^^^^^^^^^^
AttributeError: 'AuthPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleAuthPacketUnknownHost (tests.testServer.AuthPacketHandlingTests.testHandleAuthPacketUnknownHost)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 161, in testHandleAuthPacketUnknownHost
    self.server._HandleAuthPacket(self.packet)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/server.py", line 218, in _HandleAuthPacket
    self._AddSecret(pkt)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/server.py", line 207, in _AddSecret
    raise ServerPacketError('Received packet from unknown host')
pyrad.server.ServerPacketError: Received packet from unknown host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 163, in testHandleAuthPacketUnknownHost
    self.failUnless('unknown host' in str(e))
    ^^^^^^^^^^^^^^^
AttributeError: 'AuthPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testHandleAuthPacketWrongPort (tests.testServer.AuthPacketHandlingTests.testHandleAuthPacketWrongPort)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 170, in testHandleAuthPacketWrongPort
    self.server._HandleAuthPacket(self.packet)
  File "/builddir/build/BUILD/pyrad-2.4/pyrad/server.py", line 220, in _HandleAuthPacket
    raise ServerPacketError(
pyrad.server.ServerPacketError: Received non-authentication packet on authentication port

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 172, in testHandleAuthPacketWrongPort
    self.failUnless('port' in str(e))
    ^^^^^^^^^^^^^^^
AttributeError: 'AuthPacketHandlingTests' object has no attribute 'failUnless'

======================================================================
ERROR: testCreateReplyPacket (tests.testServer.OtherTests.testCreateReplyPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 245, in testCreateReplyPacket
    self.failUnless(isinstance(reply, TrivialObject))
    ^^^^^^^^^^^^^^^
AttributeError: 'OtherTests' object has no attribute 'failUnless'

======================================================================
ERROR: testRunInitializes (tests.testServer.ServerRunTests.testRunInitializes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 288, in testRunInitializes
    self.failUnless(isinstance(self.server._fdmap, dict))
    ^^^^^^^^^^^^^^^
AttributeError: 'ServerRunTests' object has no attribute 'failUnless'

======================================================================
ERROR: testGrabPacket (tests.testServer.SocketTests.testGrabPacket)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyrad-2.4/tests/testServer.py", line 113, in testGrabPacket
    self.failUnless(isinstance(pkt, TrivialObject))
    ^^^^^^^^^^^^^^^
AttributeError: 'SocketTests' object has no attribute 'failUnless'

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/05129577-python-pyrad/

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

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 Ben Cotton 2023-02-07 15:03:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Antonio Torres 2023-07-12 11:02:16 UTC
Fixed in https://bodhi.fedoraproject.org/updates/FEDORA-2023-77c2282bd6


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