Bug 2345526 - python-redis fails to build with Python 3.14: TypeError: 'NoneType' object is not subscriptable
Summary: python-redis fails to build with Python 3.14: TypeError: 'NoneType' object is...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-redis
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2326927 (view as bug list)
Depends On:
Blocks: PYTHON3.14 F43FTBFS
TreeView+ depends on / blocked
 
Reported: 2025-02-13 11:39 UTC by Karolina Surma
Modified: 2025-05-29 08:07 UTC (History)
9 users (show)

Fixed In Version: python-redis-5.2.1-3.fc43
Clone Of:
Environment:
Last Closed: 2025-05-29 08:07:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-redis pull-request 15 0 None None None 2025-05-26 12:38:17 UTC

Description Karolina Surma 2025-02-13 11:39:33 UTC
python-redis fails to build with Python 3.14.05.

9 tests fail with the same issue:
____________________ TestMultiprocessing.test_redis_client _____________________

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

    def test_redis_client(self, r):
        "A redis 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:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/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=1000 initial>
file = <_io.BytesIO object at 0x7f10028767f0>, 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_redis_client.<locals>.target at 0x7f1002758670>
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/08651086-python-redis/

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

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 Karolina Surma 2025-03-12 14:10:11 UTC
*** Bug 2326927 has been marked as a duplicate of this bug. ***

Comment 2 Karolina Surma 2025-03-12 14:10:48 UTC
Merged upstream: https://github.com/redis/redis-py/pull/3442

Comment 3 Karolina Surma 2025-05-16 13:38:25 UTC
With b1 there is another issue happening 6 times:

=================================== FAILURES ===================================
_______________ TestMonitor.test_command_with_quoted_key[single] _______________

self = <tests.test_asyncio.test_monitor.TestMonitor object at 0x7f2e9f93d6d0>
r = <redis.asyncio.client.Redis(<redis.asyncio.connection.ConnectionPool(<redis.asyncio.connection.Connection(host=localhost,port=6379,db=0)>)>)>

    async def test_command_with_quoted_key(self, r):
        async with r.monitor() as m:
            await r.get('foo"bar')
            response = await wait_for_command(r, m, 'GET foo"bar')
>           assert response["command"] == 'GET foo"bar'
E           TypeError: 'NoneType' object is not subscriptable

tests/test_asyncio/test_monitor.py:31: TypeError

Comment 4 Karolina Surma 2025-05-16 13:51:49 UTC
This is not related to Python 3.14 per se: https://koschei.fedoraproject.org/package/python-redis

Comment 5 Kevin Fenzi 2025-05-17 17:15:08 UTC
This seems to perhaps be fixed by https://github.com/redis/redis-py/pull/3442 which is in the new release that just dropped a few days ago.

They seem to have moved all the test setup around though, so will require a bit of work...

Comment 6 Miro Hrončok 2025-05-26 12:26:18 UTC
(In reply to Kevin Fenzi from comment #5)
> This seems to perhaps be fixed by
> https://github.com/redis/redis-py/pull/3442 which is in the new release that
> just dropped a few days ago.

We have that patch rebased for the currently packaged version, but the 6 new test failures as visible since valley 8.1 in https://koschei.fedoraproject.org/package/python-redis block us.

I'll open a PR to skip them, but this should probably be brought upstream.

Comment 8 Miro Hrončok 2025-05-26 13:00:34 UTC
> I'll open a PR to skip them, but this should probably be brought upstream.

I found https://github.com/valkey-io/valkey/issues/2035


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