Bug 2345510 - python-zmq fails to build with Python 3.14: zmq.error.ZMQError: Socket operation on non-socket
Summary: python-zmq fails to build with Python 3.14: zmq.error.ZMQError: Socket operat...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-zmq
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ben Beasley
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-02-13 10:17 UTC by Karolina Surma
Modified: 2025-02-14 08:03 UTC (History)
5 users (show)

Fixed In Version: python-zmq-26.2.1-3.fc43
Clone Of:
Environment:
Last Closed: 2025-02-13 16:55:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-02-13 10:17:16 UTC
python-zmq fails to build with Python 3.14.05.

10 tests fail with similar traceback:

_______________________ TestPubLog.test_unicode_message ________________________

self = <tests.test_log.TestPubLog testMethod=test_unicode_message>

    def test_unicode_message(self):
        logger, handler, sub = self.connect_handler()
        base_topic = (self.topic + '.INFO').encode()
        for msg, expected in [
            ('hello', [base_topic, b'hello\n']),
            ('héllo', [base_topic, 'héllo\n'.encode()]),
            ('tøpic::héllo', [base_topic + '.tøpic'.encode(), 'héllo\n'.encode()]),
        ]:
>           logger.info(msg)

tests/test_log.py:136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.14/logging/__init__.py:1519: in info
    self._log(INFO, msg, args, **kwargs)
/usr/lib64/python3.14/logging/__init__.py:1664: in _log
    self.handle(record)
/usr/lib64/python3.14/logging/__init__.py:1680: in handle
    self.callHandlers(record)
/usr/lib64/python3.14/logging/__init__.py:1736: in callHandlers
    hdlr.handle(record)
/usr/lib64/python3.14/logging/__init__.py:1026: in handle
    self.emit(record)
../../BUILDROOT/usr/lib64/python3.14/site-packages/zmq/log/handlers.py:188: in emit
    self.socket.send_multipart([btopic, bmsg])
../../BUILDROOT/usr/lib64/python3.14/site-packages/zmq/sugar/socket.py:758: in send_multipart
    self.send(msg, zmq.SNDMORE | flags, copy=copy, track=track)
../../BUILDROOT/usr/lib64/python3.14/site-packages/zmq/sugar/socket.py:707: in send
    return super().send(data, flags=flags, copy=copy, track=track)
_zmq.py:1092: in zmq.backend.cython._zmq.Socket.send
    ???
_zmq.py:1134: in zmq.backend.cython._zmq.Socket.send
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   zmq.error.ZMQError: Socket operation on non-socket

_zmq.py:1209: ZMQError


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/08651417-python-zmq/

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

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 Ben Beasley 2025-02-13 16:38:38 UTC
I couldn’t reproduce *this* error, but I reproduced a different error:

=================================== FAILURES ===================================
____________________________ test_process_teardown _____________________________

request = <FixtureRequest for <Function test_process_teardown>>

    def test_process_teardown(request):
        proc = ProcessForTeardownTest()
        proc.start()
        request.addfinalizer(proc.terminate)
        proc.join(10)  # starting new Python process may cost a lot
        assert proc.exitcode is not None, "process teardown hangs"
>       assert proc.exitcode == 0, f"Python process died with code {proc.exitcode}"
E       AssertionError: Python process died with code 1
E       assert 1 == 0
E        +  where 1 = <ProcessForTeardownTest name='ProcessForTeardownTest-1' pid=1367 parent=1306 stopped exitcode=1>.exitcode

tests/test_asyncio.py:388: AssertionError
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):  
  File "/usr/lib64/python3.14/multiprocessing/forkserver.py", line 335, in main
    code = _serve_one(child_r, fds, 
                      unused_fds,   
                      old_handlers) 
  File "/usr/lib64/python3.14/multiprocessing/forkserver.py", line 375, in _serve_one
    code = spawn._main(child_r, parent_sentinel)
  File "/usr/lib64/python3.14/multiprocessing/spawn.py", line 132, in _main
    self = reduction.pickle.load(from_parent)
ModuleNotFoundError: No module named 'tests'

I fixed that in https://src.fedoraproject.org/rpms/python-zmq/pull-request/20, and that PR built successfully in COPR as https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8652276/, so I’m going to call it a fix even though it doesn’t match the original report.

Please do reopen this if you start seeing "zmq.error.ZMQError: Socket operation on non-socket" again. While I built this several times in mock using packages from the Python 3.14 COPR, there could still be some kind of flaky testing issue.

Comment 2 Fedora Update System 2025-02-13 16:49:06 UTC
FEDORA-2025-2e53d31ab3 (python-zmq-26.2.1-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-2e53d31ab3

Comment 3 Fedora Update System 2025-02-13 16:55:40 UTC
FEDORA-2025-2e53d31ab3 (python-zmq-26.2.1-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Karolina Surma 2025-02-14 08:03:16 UTC
Thank you. Things change in Copr so dynamically it's often tricky to determine what's one-off and what's persistent.


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