Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DeprecationError when ussing assert_ since python 3.12 #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mirespace
Copy link

Dear Maintainer,

In Ubuntu we cannot build this package (FTBFS): since python3.12, the assert_ method no longer exists [1]. We could see a deprecation warning for this in previous builds, like this one for Focal [2]:

test_object_hook (tests.PhpSerializeTestCase) ... /<>/tests.py:92: DeprecationWarning: Please use assertTrue instead.
self.assert_(b'WP_User' in x)

In Debian, they still use Python3.11 (so they have the warning, not the error like us) [3].

I'm submitting here the change that we have already incorporated into the Ubuntu package for your awareness in case you find it useful.

Thanks in advance!

[1] https://docs.python.org/3/library/unittest.html#assert-methods
[2] https://launchpadlibrarian.net/448504127/buildlog_ubuntu-focal-amd64.python-phpserialize_1.3-1.1_BUILDING.txt.gz
[3] https://buildd.debian.org/status/fetch.php?pkg=python-phpserialize&arch=all&ver=1.3-2&stamp=1712878490&raw=0

tests.py Outdated Show resolved Hide resolved
As noted by bdrung, it will throw a better error message when needed.

Co-authored-by: Benjamin Drung <bdrung@ubuntu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants