cocagne / txdbus

Native Python implementation of DBus for Twisted
MIT License
61 stars 38 forks source link

tests broken on Python 3.12 #95

Open goffi-contrib opened 1 month ago

goffi-contrib commented 1 month ago

Hello,

tests are broken on Python 3.12 due to the use of deprecated plural variant of method names such as assertEquals, see Python 3.12 release notes for details: https://docs.python.org/3.12/whatsnew/3.12.html#id3

One example line where it's used: https://github.com/cocagne/txdbus/blob/master/tests/test_authentication.py#L439

The fix is straightforward, the final s must be removed on the methods listed in the documentation above.

Thanks!

goffi-contrib commented 1 month ago

Here are the patches used in Debian to fix this issue and #96 https://salsa.debian.org/python-team/packages/txdbus/-/tree/debian/master/debian/patches?ref_type=heads

WhyNotHugo commented 1 month ago

This was fixed in 2204dcec44e62b60290c552352b170cfdf842ee6

We need to cut a new release.

WhyNotHugo commented 1 month ago

Actually, only the assertEquals part was fixed, but tests still fail on 3.12.

WhyNotHugo commented 1 month ago

See: https://github.com/cocagne/txdbus/pull/97

I still have one test failing:

[ERROR]
Traceback (most recent call last):
  File "/home/hugo/src/github.com/cocagne/txdbus/tests/client_tests.py", line 2347, in test_call_with_two_UNIX_FD_args
    result = yield ro.callRemote(
twisted.internet.error.ConnectionDone: Connection was closed cleanly.

tests.test_client_against_native_bus.UnixFDArgumentsTester.test_call_with_two_UNIX_FD_args

Unsure what's causing this.

gudnimg commented 1 month ago

Hi I found that the test passes with this change:

This only seems to be an issue when the signature is hh. A simple h works fine. Sounds like an issue in parsing somewhere if ii works.

image

Edit: To add more info… I could reproduce the issue using WSL with Ubuntu 24.04. It used Python 3.12.3. To use the session d-bus I had to use loginctl. The session bus isnt enabled by default on WSL.

I also tried downgrading Twisted as far back as I could. I could install everything above 19.7.0. The issue persistent with every release. I’m not convinced this is a twisted issue.