Skip to content

shield() documentation should mention user needs to keep reference to the task #94972

@graingert

Description

@graingert

Documentation

asyncio will only keep weak references to alive tasks (in _all_tasks). If a user does not keep a reference to a task and the task is not currently executing or sleeping, the user may get "Task was destroyed but it is pending!".

see also #88831

shield has the same issue and the documentation currently recommends the incorrect usage

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions