bpo-33694: asyncio: Fix race in Proactor's Transport.set_protocol() by 1st1 · Pull Request #7486 · python/cpython (original) (raw)

Refactor Proactor's data receiving code path. The idea is to always use
recv_into() and to emulate the old Protocol.data_received() path. This way
there is no read cancellation race or data loss in set_protocol() and
there's no performance degradation for both Protocol and BufferedProtocol.

This PR removes some outdated and now irrelevant proactor mock tests
(most of the removed mocked tests have an alternative working test
for BufferedProtocol).

https://bugs.python.org/issue33694