Bug 2326934 - python-valkey fails to build with Python 3.14: _pickle.PicklingError: Can't pickle local object <function TestMultiprocessing.test_close_connection_in_child.<locals>.target at 0x7f7d711b5dd0>
Summary: python-valkey fails to build with Python 3.14: _pickle.PicklingError: Can't p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-valkey
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matteo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-18 09:18 UTC by Karolina Surma
Modified: 2025-03-15 00:40 UTC (History)
9 users (show)

Fixed In Version: python-valkey-6.1.0-2.fc42
Clone Of:
Environment:
Last Closed: 2025-03-15 00:40:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-11-18 09:18:52 UTC
python-valkey fails to build with Python 3.14.0a1.


____________________ TestMultiprocessing.test_valkey_client ____________________

self = <tests.test_multiprocessing.TestMultiprocessing object at 0x7f7d823ea350>
r = <valkey.client.Valkey(<valkey.connection.ConnectionPool(<valkey.connection.Connection(host=localhost,port=6379,db=0)>)>)>

    def test_valkey_client(self, r):
        "A valkey client created in a parent can also be used in a child"
        assert r.ping() is True
    
        def target(client):
            assert client.ping() is True
            del client
    
        proc = multiprocessing.Process(target=target, args=(r,))
>       proc.start()

tests/test_multiprocessing.py:165: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.14/multiprocessing/process.py:121: in start
    self._popen = self._Popen(self)
/usr/lib64/python3.14/multiprocessing/context.py:224: in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
/usr/lib64/python3.14/multiprocessing/context.py:300: in _Popen
    return Popen(process_obj)
/usr/lib64/python3.14/multiprocessing/popen_forkserver.py:35: in __init__
    super().__init__(process_obj)
/usr/lib64/python3.14/multiprocessing/popen_fork.py:20: in __init__
    self._launch(process_obj)
/usr/lib64/python3.14/multiprocessing/popen_forkserver.py:47: in _launch
    reduction.dump(process_obj, buf)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = <Process name='Process-9' parent=1010 initial>
file = <_io.BytesIO object at 0x7f7d7003aed0>, protocol = None

    def dump(obj, file, protocol=None):
        '''Replacement for pickle.dump() using ForkingPickler.'''
>       ForkingPickler(file, protocol).dump(obj)
E       _pickle.PicklingError: Can't pickle local object <function TestMultiprocessing.test_valkey_client.<locals>.target at 0x7f7d700d2560>
E       when serializing dict item '_target'
E       when serializing multiprocessing.context.Process state
E       when serializing multiprocessing.context.Process object

/usr/lib64/python3.14/multiprocessing/reduction.py:60: PicklingError

According to https://docs.python.org/dev/whatsnew/3.14.html#multiprocessing

The default start method (see Contexts and start methods) changed from fork to forkserver on platforms other than macOS & Windows where it was already spawn. If you require the threading incompatible fork start method you must explicitly request it using a context from multiprocessing.get_context() (preferred) or change the default via multiprocessing.set_start_method(). (Contributed by Gregory P. Smith in gh-84559.)


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/08257930-python-valkey/

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

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 Matteo 2024-11-18 09:50:20 UTC
Hello! I will try to have a look at this and also provide the fix back to the upstream project.
Thanks for raising the issue.

Comment 2 Matteo 2024-11-29 08:10:46 UTC
I'm in touch with the upstream maintainers and I'm waiting for a fix to be relased, at the moment there are tests that fails.  As soon as the new release will be available, I'll work on having also this issue fixed.

Comment 3 Matteo 2025-02-11 16:08:04 UTC
I got a test build to succeed: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8640715

I'll try to work on a PR to submit upstream ASAP.

Comment 4 Aoife Moloney 2025-02-26 13:17:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 5 Fedora Update System 2025-03-04 13:46:06 UTC
FEDORA-2025-187b62f9da (python-valkey-6.1.0-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-187b62f9da

Comment 6 Fedora Update System 2025-03-05 02:24:24 UTC
FEDORA-2025-187b62f9da 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-187b62f9da`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-187b62f9da

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

Comment 7 Fedora Update System 2025-03-15 00:40:05 UTC
FEDORA-2025-187b62f9da (python-valkey-6.1.0-2.fc42) has been pushed to the Fedora 42 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.