agronholm / agronholm/anyio

`TaskGroup.__aexit__` visits a cancel point on asyncio

Aberta
#1,069 0 comentários 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Python
Estrelas
2.5k
Forks
260
Merge médio
2d 8h
PRs com merge (30d)
19

Descrição

### Things to check first

- [x] I have searched the existing issues and didn't find my bug already reported there

- [x] I have checked that my bug is still present in the latest release

### AnyIO version

main (a2a07c7c7af5d0f154b770f280d8772299a20a38)

### Python version

CPython 3.10.19, 3.11.14, 3.12.12, 3.13.11, 3.14.2

### What happened?

In a cancelled scope, or with a pending native cancellation, `TaskGroup` on asyncio injects a cancellation exception even when no child exited with a cancellation exception. This violates Trio's cancellation safety semantics: see https://github.com/python-trio/trio/blob/b0732873e851b6c6f75d5b819ea4f8a063029f52/newsfragments/1457.feature.rst and https://github.com/python-trio/trio/commit/451393acec35c3a01cba0c19de6bf8f6f23dbc7b.

### How can we reproduce the bug?

f637fb6c93cf625b9615c260767e5e21b231e381

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.