Bug 2349444 - 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 0x7f5aa68cddd0>
Summary: python-valkey fails to build with Python 3.14: _pickle.PicklingError: Can't p...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: python-valkey
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matteo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-03-03 09:05 UTC by Karolina Surma
Modified: 2025-03-04 13:24 UTC (History)
8 users (show)

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


Attachments (Terms of Use)

Description Karolina Surma 2025-03-03 09:05:25 UTC
python-valkey fails to build with Python 3.14.0a5.


____________________ TestMultiprocessing.test_valkey_client ____________________

self = <tests.test_multiprocessing.TestMultiprocessing object at 0x7f5aa6170c50>
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 0x7f5aa9478810>, 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 0x7f5aa68b1bc0>
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

FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_close_connection_in_child
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_close_connection_in_parent
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_pool[1] - _pi...
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_pool[2] - _pi...
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_pool[None] - ...
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_close_pool_in_main[1]
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_close_pool_in_main[2]
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_close_pool_in_main[None]
FAILED tests/test_multiprocessing.py::TestMultiprocessing::test_valkey_client

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/08671154-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 2 Matteo 2025-03-04 13:24:58 UTC
(In reply to Matteo from comment #1)
> Build succeeded in
> https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8722580/h

The correct link to the build is https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8722580/


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