Skip to content

Event.set() with an EventAdapter does not work unless already running in an async event loop #819

@fyellin

Description

@fyellin

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.6.2

Python version

3.12

What happened?

Unexpected exception. Code that runs fine with trio and asyncio fails with anyio.

How can we reproduce the bug?

In a newly started Python:

from anyio import Event
event = Event()
event.set()

This code works fine if we replace anyio with trio or asyncio. On anyio I get the error message AsyncLibraryNotFound.

It seems strange that anyio has no problem creating the Event, but fails in setting it.

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