Fix DeprecationError when ussing assert_ since python 3.12 #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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