Skip to content

Test failures with Python 3.14.0b2: ValueError: unsupported unboundop 0 #926

@hroncok

Description

@hroncok

Things to check first

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

AnyIO version

4.9.0.post32

Python version

3.14.0b2

What happened?

============================= test session starts ==============================
platform linux -- Python 3.14.0b2, pytest-8.3.5, pluggy-1.6.0
rootdir: .../anyio
configfile: pyproject.toml
plugins: anyio-4.9.0.post32, hypothesis-6.131.28
collected 12 items

tests/test_to_interpreter.py FsFFFsFFFsFF                                [100%]

=================================== FAILURES ===================================
____________________________ test_run_sync[asyncio] ____________________________
tests/test_to_interpreter.py:37: in test_run_sync
    interpreter_id, _ = await to_interpreter.run_sync(_interpreters.get_current)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:2470: in run_sync_in_worker_thread
    return await future
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:967: in run
    result = context.run(func, *args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0
_________________________ test_run_sync[asyncio+eager] _________________________
tests/test_to_interpreter.py:37: in test_run_sync
    interpreter_id, _ = await to_interpreter.run_sync(_interpreters.get_current)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:2470: in run_sync_in_worker_thread
    return await future
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:967: in run
    result = context.run(func, *args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0
_____________________________ test_run_sync[trio] ______________________________
tests/test_to_interpreter.py:37: in test_run_sync
    interpreter_id, _ = await to_interpreter.run_sync(_interpreters.get_current)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_trio.py:1080: in run_sync_in_worker_thread
    return await run_sync(
venv/lib64/python3.14/site-packages/trio/_threads.py:447: in to_thread_run_sync
    return msg_from_thread.unwrap()
venv/lib64/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
venv/lib64/python3.14/site-packages/trio/_threads.py:373: in do_release_then_return_result
    return result.unwrap()
venv/lib64/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
venv/lib64/python3.14/site-packages/trio/_threads.py:392: in worker_fn
    ret = context.run(sync_fn, *args)
venv/lib64/python3.14/site-packages/anyio/_backends/_trio.py:1077: in wrapper
    return func(*args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0
__________________________ test_args_kwargs[asyncio] ___________________________
tests/test_to_interpreter.py:45: in test_args_kwargs
    result = await to_interpreter.run_sync(partial(sorted, reverse=True), ["a", "b"])
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:2470: in run_sync_in_worker_thread
    return await future
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:967: in run
    result = context.run(func, *args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0
_______________________ test_args_kwargs[asyncio+eager] ________________________
tests/test_to_interpreter.py:45: in test_args_kwargs
    result = await to_interpreter.run_sync(partial(sorted, reverse=True), ["a", "b"])
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:2470: in run_sync_in_worker_thread
    return await future
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:967: in run
    result = context.run(func, *args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0
____________________________ test_args_kwargs[trio] ____________________________
tests/test_to_interpreter.py:45: in test_args_kwargs
    result = await to_interpreter.run_sync(partial(sorted, reverse=True), ["a", "b"])
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_trio.py:1080: in run_sync_in_worker_thread
    return await run_sync(
venv/lib64/python3.14/site-packages/trio/_threads.py:447: in to_thread_run_sync
    return msg_from_thread.unwrap()
venv/lib64/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
venv/lib64/python3.14/site-packages/trio/_threads.py:373: in do_release_then_return_result
    return result.unwrap()
venv/lib64/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
venv/lib64/python3.14/site-packages/trio/_threads.py:392: in worker_fn
    ret = context.run(sync_fn, *args)
venv/lib64/python3.14/site-packages/anyio/_backends/_trio.py:1077: in wrapper
    return func(*args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0
___________________________ test_exception[asyncio] ____________________________
tests/test_to_interpreter.py:52: in test_exception
    assert await to_interpreter.run_sync(int, "a")
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:2470: in run_sync_in_worker_thread
    return await future
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:967: in run
    result = context.run(func, *args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0

During handling of the above exception, another exception occurred:
tests/test_to_interpreter.py:51: in test_exception
    with pytest.raises(ValueError, match="invalid literal for int"):
E   AssertionError: Regex pattern did not match.
E    Regex: 'invalid literal for int'
E    Input: 'unsupported unboundop 0'
________________________ test_exception[asyncio+eager] _________________________
tests/test_to_interpreter.py:52: in test_exception
    assert await to_interpreter.run_sync(int, "a")
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:2470: in run_sync_in_worker_thread
    return await future
venv/lib64/python3.14/site-packages/anyio/_backends/_asyncio.py:967: in run
    result = context.run(func, *args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0

During handling of the above exception, another exception occurred:
tests/test_to_interpreter.py:51: in test_exception
    with pytest.raises(ValueError, match="invalid literal for int"):
E   AssertionError: Regex pattern did not match.
E    Regex: 'invalid literal for int'
E    Input: 'unsupported unboundop 0'
_____________________________ test_exception[trio] _____________________________
tests/test_to_interpreter.py:52: in test_exception
    assert await to_interpreter.run_sync(int, "a")
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:189: in run_sync
    return await worker.call(func, args, limiter)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:126: in call
    result, is_exception = await to_thread.run_sync(
venv/lib64/python3.14/site-packages/anyio/to_thread.py:56: in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
venv/lib64/python3.14/site-packages/anyio/_backends/_trio.py:1080: in run_sync_in_worker_thread
    return await run_sync(
venv/lib64/python3.14/site-packages/trio/_threads.py:447: in to_thread_run_sync
    return msg_from_thread.unwrap()
venv/lib64/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
venv/lib64/python3.14/site-packages/trio/_threads.py:373: in do_release_then_return_result
    return result.unwrap()
venv/lib64/python3.14/site-packages/outcome/_impl.py:213: in unwrap
    raise captured_error
venv/lib64/python3.14/site-packages/trio/_threads.py:392: in worker_fn
    ret = context.run(sync_fn, *args)
venv/lib64/python3.14/site-packages/anyio/_backends/_trio.py:1077: in wrapper
    return func(*args)
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:104: in _call
    self.initialize()
venv/lib64/python3.14/site-packages/anyio/to_interpreter.py:75: in initialize
    self._queue_id = queues.create(2, FMT_UNPICKLED, UNBOUND)
E   ValueError: unsupported unboundop 0

During handling of the above exception, another exception occurred:
tests/test_to_interpreter.py:51: in test_exception
    with pytest.raises(ValueError, match="invalid literal for int"):
E   AssertionError: Regex pattern did not match.
E    Regex: 'invalid literal for int'
E    Input: 'unsupported unboundop 0'
=========================== short test summary info ============================
SKIPPED [1] tests/test_to_interpreter.py:28: uvloop not available
SKIPPED [1] tests/test_to_interpreter.py:43: uvloop not available
SKIPPED [1] tests/test_to_interpreter.py:49: uvloop not available
FAILED tests/test_to_interpreter.py::test_run_sync[asyncio] - ValueError: uns...
FAILED tests/test_to_interpreter.py::test_run_sync[asyncio+eager] - ValueErro...
FAILED tests/test_to_interpreter.py::test_run_sync[trio] - ValueError: unsupp...
FAILED tests/test_to_interpreter.py::test_args_kwargs[asyncio] - ValueError: ...
FAILED tests/test_to_interpreter.py::test_args_kwargs[asyncio+eager] - ValueE...
FAILED tests/test_to_interpreter.py::test_args_kwargs[trio] - ValueError: uns...
FAILED tests/test_to_interpreter.py::test_exception[asyncio] - AssertionError...
FAILED tests/test_to_interpreter.py::test_exception[asyncio+eager] - Assertio...
FAILED tests/test_to_interpreter.py::test_exception[trio] - AssertionError: R...
========================= 9 failed, 3 skipped in 0.66s =========================

How can we reproduce the bug?

[anyio (master)]$ git rev-parse @
9c876b11a3ed3c63721789b67beeb8126563301f
[anyio (master)]$ uv venv --python=python3.14 venv
[anyio (master)]$ . venv/bin/activate
(venv) [anyio (master)]$ uv pip install .[trio] blockbuster exceptiongroup hypothesis psutil trustme truststore
...
(venv) [anyio (master)]$ uv pip list
Using Python 3.14.0b2 environment at: venv
Package          Version
---------------- ------------
anyio            4.9.0.post32
attrs            25.3.0
blockbuster      1.5.24
cffi             1.17.1
cryptography     45.0.3
exceptiongroup   1.3.0
forbiddenfruit   0.1.4
hypothesis       6.131.28
idna             3.10
iniconfig        2.1.0
outcome          1.3.0.post0
packaging        25.0
pluggy           1.6.0
psutil           7.0.0
pycparser        2.22
pytest           8.3.5
sniffio          1.3.1
sortedcontainers 2.4.0
trio             0.30.0
trustme          1.2.1
truststore       0.10.1
(venv) [anyio (master)]$ pytest tests/test_to_interpreter.py  # or just pytest, but this is faster

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions