Bug 2359502 - pylibacl fails to build with Python 3.14: tests/test_acls.py::TestModification: Failed: Wrong reference count, expected 2-1024 and got 1
Summary: pylibacl fails to build with Python 3.14: tests/test_acls.py::TestModificatio...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: pylibacl
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marcin Zajaczkowski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-04-14 13:35 UTC by Karolina Surma
Modified: 2025-04-14 15:56 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-04-14 13:35:23 UTC
pylibacl fails to build with Python 3.14.0a7.

=================================== FAILURES ===================================
__________________________ TestModification.test_str ___________________________

self = <test_acls.TestModification object at 0x7f42405dc410>

    def test_str(self):
        """Test str() of an ACL."""
        acl = posix1e.ACL(text=BASIC_ACL_TEXT)
        str_acl = str(acl)
>       self.checkRef(str_acl)

tests/test_acls.py:580: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405dc410>
obj = 'user::rw-\ngroup::r--\nother::---\n'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
_________________________ TestModification.test_append _________________________

self = <test_acls.TestModification object at 0x7f42405dc550>

    def test_append(self):
        """Test append a new Entry to the ACL"""
        acl = posix1e.ACL()
        e = acl.append()
        e.tag_type = posix1e.ACL_OTHER
        ignore_ioerror(errno.EINVAL, acl.calc_mask)
        str_format = str(e)
>       self.checkRef(str_format)

tests/test_acls.py:589: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405dc550>
obj = 'ACL entry for the others'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
_____________________ TestModification.test_entry_creation _____________________

self = <test_acls.TestModification object at 0x7f4240b7dfd0>

    def test_entry_creation(self):
        acl = posix1e.ACL()
        e = posix1e.Entry(acl)
        ignore_ioerror(errno.EINVAL, acl.calc_mask)
        str_format = str(e)
>       self.checkRef(str_format)

tests/test_acls.py:616: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f4240b7dfd0>
obj = 'ACL entry for undefined type'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
_____________________ TestModification.test_permset[read] ______________________

self = <test_acls.TestModification object at 0x7f42405cee40>, perm = 4
txt = 'read'

    @pytest.mark.parametrize("perm, txt, accessor",
                             PERMSETS, ids=PERMSETS_IDS)
    def test_permset(self, perm, txt, accessor):
        """Test permissions"""
        del accessor
        acl = posix1e.ACL()
        e = acl.append()
        ps = e.permset
        ps.clear()
        str_ps = str(ps)
>       self.checkRef(str_ps)

tests/test_acls.py:831: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405cee40>, obj = '---'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
_____________________ TestModification.test_permset[write] _____________________

self = <test_acls.TestModification object at 0x7f424062ef30>, perm = 2
txt = 'write'

    @pytest.mark.parametrize("perm, txt, accessor",
                             PERMSETS, ids=PERMSETS_IDS)
    def test_permset(self, perm, txt, accessor):
        """Test permissions"""
        del accessor
        acl = posix1e.ACL()
        e = acl.append()
        ps = e.permset
        ps.clear()
        str_ps = str(ps)
>       self.checkRef(str_ps)

tests/test_acls.py:831: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f424062ef30>, obj = '---'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
____________________ TestModification.test_permset[execute] ____________________

self = <test_acls.TestModification object at 0x7f424062ef90>, perm = 1
txt = 'execute'

    @pytest.mark.parametrize("perm, txt, accessor",
                             PERMSETS, ids=PERMSETS_IDS)
    def test_permset(self, perm, txt, accessor):
        """Test permissions"""
        del accessor
        acl = posix1e.ACL()
        e = acl.append()
        ps = e.permset
        ps.clear()
        str_ps = str(ps)
>       self.checkRef(str_ps)

tests/test_acls.py:831: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f424062ef90>, obj = '---'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
______________ TestModification.test_permset_via_accessors[read] _______________

self = <test_acls.TestModification object at 0x7f42405d0780>, perm = 4
txt = 'read', accessor = <attribute 'read' of 'posix1e.Permset' objects>

    @pytest.mark.parametrize("perm, txt, accessor",
                             PERMSETS, ids=PERMSETS_IDS)
    def test_permset_via_accessors(self, perm, txt, accessor):
        """Test permissions"""
        acl = posix1e.ACL()
        e = acl.append()
        ps = e.permset
        ps.clear()
        def getter():
            return accessor.__get__(ps) # type: ignore
        def setter(value):
            return accessor.__set__(ps, value) # type: ignore
        str_ps = str(ps)
>       self.checkRef(str_ps)

tests/test_acls.py:864: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405d0780>, obj = '---'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
______________ TestModification.test_permset_via_accessors[write] ______________

self = <test_acls.TestModification object at 0x7f42405d0820>, perm = 2
txt = 'write', accessor = <attribute 'write' of 'posix1e.Permset' objects>

    @pytest.mark.parametrize("perm, txt, accessor",
                             PERMSETS, ids=PERMSETS_IDS)
    def test_permset_via_accessors(self, perm, txt, accessor):
        """Test permissions"""
        acl = posix1e.ACL()
        e = acl.append()
        ps = e.permset
        ps.clear()
        def getter():
            return accessor.__get__(ps) # type: ignore
        def setter(value):
            return accessor.__set__(ps, value) # type: ignore
        str_ps = str(ps)
>       self.checkRef(str_ps)

tests/test_acls.py:864: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405d0820>, obj = '---'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
_____________ TestModification.test_permset_via_accessors[execute] _____________

self = <test_acls.TestModification object at 0x7f42405d08c0>, perm = 1
txt = 'execute', accessor = <attribute 'execute' of 'posix1e.Permset' objects>

    @pytest.mark.parametrize("perm, txt, accessor",
                             PERMSETS, ids=PERMSETS_IDS)
    def test_permset_via_accessors(self, perm, txt, accessor):
        """Test permissions"""
        acl = posix1e.ACL()
        e = acl.append()
        ps = e.permset
        ps.clear()
        def getter():
            return accessor.__get__(ps) # type: ignore
        def setter(value):
            return accessor.__set__(ps, value) # type: ignore
        str_ps = str(ps)
>       self.checkRef(str_ps)

tests/test_acls.py:864: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_acls.TestModification object at 0x7f42405d08c0>, obj = '---'

    def checkRef(self, obj):
        """Checks if a given obj has a 'sane' refcount"""
        if platform.python_implementation() == "PyPy":
            return
        ref_cnt = sys.getrefcount(obj)
        # FIXME: hardcoded value for the max ref count... but I've
        # seen it overflow on bad reference counting, so it's better
        # to be safe
        if ref_cnt < 2 or ref_cnt > 1024:
>           pytest.fail("Wrong reference count, expected 2-1024 and got %d" %
                        ref_cnt)
E           Failed: Wrong reference count, expected 2-1024 and got 1

tests/test_acls.py:573: Failed
=========================== short test summary info ============================
FAILED tests/test_acls.py::TestModification::test_str - Failed: Wrong referen...
FAILED tests/test_acls.py::TestModification::test_append - Failed: Wrong refe...
FAILED tests/test_acls.py::TestModification::test_entry_creation - Failed: Wr...
FAILED tests/test_acls.py::TestModification::test_permset[read] - Failed: Wro...
FAILED tests/test_acls.py::TestModification::test_permset[write] - Failed: Wr...
FAILED tests/test_acls.py::TestModification::test_permset[execute] - Failed: ...
FAILED tests/test_acls.py::TestModification::test_permset_via_accessors[read]
FAILED tests/test_acls.py::TestModification::test_permset_via_accessors[write]
FAILED tests/test_acls.py::TestModification::test_permset_via_accessors[execute]
============= 9 failed, 139 passed, 3 xfailed, 1 xpassed in 0.37s ==============

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08899182-pylibacl/

For all our attempts to build pylibacl with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/pylibacl/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Marcin Zajaczkowski 2025-04-14 15:56:38 UTC
Thanks for reporting.

I reproduced the problem on the upstream CI and created an issue: https://github.com/iustin/pylibacl/issues/31


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