Bug 2351386 - copr-backend fails to build with Python 3.14: TestActionWorkerManager.test_add_task_for_running_worker: TypeError: cannot pickle 'itertools.count' object
Summary: copr-backend fails to build with Python 3.14: TestActionWorkerManager.test_ad...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: copr-backend
Version: 43
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Copr Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2371698 (view as bug list)
Depends On: 2372213
Blocks: PYTHON3.14 F43FTBFS F43FailsToInstall
TreeView+ depends on / blocked
 
Reported: 2025-03-11 15:19 UTC by Karolina Surma
Modified: 2025-09-12 19:22 UTC (History)
8 users (show)

Fixed In Version: copr-backend-2.7-1.fc44 copr-backend-2.7-1.fc42 copr-backend-2.7-1.fc41 copr-backend-2.7-1.fc43
Clone Of:
Environment:
Last Closed: 2025-09-12 19:22:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-03-11 15:19:04 UTC
copr-backend fails to build with Python 3.14.0a5.

___________ TestActionWorkerManager.test_add_task_for_running_worker ___________

self = <tests.test_worker_manager.TestActionWorkerManager object at 0x7fe77aa2c160>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7fe779613a10>

    def test_add_task_for_running_worker(self, caplog):
        # at least 'toy:0' should be reeady
        self.worker_manager.run(timeout=0.0001)
    
>       queue = copy.deepcopy(self.worker_manager.tasks)

tests/test_worker_manager.py:455: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.14/copy.py:157: in deepcopy
    y = _reconstruct(x, memo, *rv)
/usr/lib64/python3.14/copy.py:240: in _reconstruct
    state = deepcopy(state, memo)
/usr/lib64/python3.14/copy.py:131: in deepcopy
    y = copier(x, memo)
/usr/lib64/python3.14/copy.py:202: in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = count(12)
memo = {140632147655680: [0, 6, 4], 140632150588256: <copr_common.worker_manager.JobQueue object at 0x7fe779613af0>, 140632156412928: [0, 8, 6], 140632156495872: [0, 4, '<removed-task>'], ...}
_nil = []

    def deepcopy(x, memo=None, _nil=[]):
        """Deep copy operation on arbitrary Python objects.
    
        See the module's __doc__ string for more info.
        """
    
        cls = type(x)
    
        if cls in _atomic_types:
            return x
    
        d = id(x)
        if memo is None:
            memo = {}
        else:
            y = memo.get(d, _nil)
            if y is not _nil:
                return y
    
        copier = _deepcopy_dispatch.get(cls)
        if copier is not None:
            y = copier(x, memo)
        else:
            if issubclass(cls, type):
                y = x # atomic copy
            else:
                copier = getattr(x, "__deepcopy__", None)
                if copier is not None:
                    y = copier(memo)
                else:
                    reductor = dispatch_table.get(cls)
                    if reductor:
                        rv = reductor(x)
                    else:
                        reductor = getattr(x, "__reduce_ex__", None)
                        if reductor is not None:
>                           rv = reductor(4)
E                           TypeError: cannot pickle 'itertools.count' object

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/08745938-copr-backend/

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

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 Miroslav Suchý 2025-03-12 10:58:44 UTC
Taken upstream https://github.com/fedora-copr/copr/issues/3662

Comment 2 Miroslav Suchý 2025-03-12 11:03:19 UTC
@ksurma I wonder why deepcopy() is not able copy (and serialize) itertools.count? Isn't this bug on Python side? Or is it new feature?

Comment 3 Karolina Surma 2025-03-12 12:39:22 UTC
Looking at What's new: https://docs.python.org/dev/whatsnew/3.14.html#itertools it's a deliberate change:
Remove itertools support for copy, deepcopy, and pickle operations. These had previously raised a DeprecationWarning since Python 3.12. (Contributed by Raymond Hettinger in gh-101588.)
More to that in the linked issue: https://github.com/python/cpython/issues/101588

Comment 4 Karolina Surma 2025-06-11 15:53:02 UTC
*** Bug 2371698 has been marked as a duplicate of this bug. ***

Comment 5 Miro Hrončok 2025-08-25 10:53:45 UTC
Miroslav, you ASSIGNED this Bugzilla in March and the upstream issue has been fixed since June. What is the downstream plan? The Beta Freeze of Fedora 43 starts tomorrow.

Comment 6 Jakub Kadlčík 2025-08-25 14:13:16 UTC
Hello Miro,
we have fixed the upstream issue
https://github.com/fedora-copr/copr/issues/3662

So the only thing that remains to do is a new Copr release. 
We are currently in the middle of preparations
https://github.com/fedora-copr/copr/issues/3822
and we are hoping to do the release on Thursday.

Comment 7 Fedora Update System 2025-08-28 07:53:35 UTC
FEDORA-EPEL-2025-d3f5eb1702 (Copr server packages) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-d3f5eb1702

Comment 8 Fedora Update System 2025-08-28 07:53:36 UTC
FEDORA-2025-b9355eccbb (Copr server packages) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-b9355eccbb

Comment 9 Fedora Update System 2025-08-28 07:53:38 UTC
FEDORA-2025-0f9baea7dc (Copr server packages) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-0f9baea7dc

Comment 10 Fedora Update System 2025-08-28 07:53:39 UTC
FEDORA-EPEL-2025-0d8a8f9f56 (Copr server packages) has been submitted as an update to Fedora EPEL 8.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-0d8a8f9f56

Comment 11 Fedora Update System 2025-08-28 07:53:39 UTC
FEDORA-2025-24fc6d6306 (Copr server packages) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-24fc6d6306

Comment 12 Fedora Update System 2025-08-29 01:20:42 UTC
FEDORA-2025-24fc6d6306 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-24fc6d6306`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-24fc6d6306

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2025-08-29 02:06:10 UTC
FEDORA-2025-b9355eccbb has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-b9355eccbb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-b9355eccbb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2025-08-29 02:19:49 UTC
FEDORA-EPEL-2025-d3f5eb1702 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-d3f5eb1702

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2025-08-29 02:24:33 UTC
FEDORA-EPEL-2025-0d8a8f9f56 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-0d8a8f9f56

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2025-08-29 02:27:59 UTC
FEDORA-2025-0f9baea7dc has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-0f9baea7dc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-0f9baea7dc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2025-09-06 02:12:30 UTC
FEDORA-2025-0f9baea7dc (Copr server packages) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2025-09-06 02:13:59 UTC
FEDORA-EPEL-2025-d3f5eb1702 (Copr server packages) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2025-09-06 02:22:23 UTC
FEDORA-EPEL-2025-0d8a8f9f56 (Copr server packages) has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2025-09-06 02:37:46 UTC
FEDORA-2025-24fc6d6306 (Copr server packages) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2025-09-12 19:22:36 UTC
FEDORA-2025-b9355eccbb (Copr server packages) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


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