Results 953 comments of Thomas Grainger

@mgorny I investigated this in pytest-httpbin and there doesn't seem to be a problem there https://github.com/kevin1024/pytest-httpbin/actions/runs/10160156943/job/28095913920?pr=90

ah seems related to https://github.com/python-trio/trustme/pull/642 and https://github.com/python/cpython/issues/107361

@mgorny I fixed this in pytest-httpbin https://github.com/kevin1024/pytest-httpbin/pull/90 can you use that branch for now? I don't plan on merging it until downstream PRs are merged: https://github.com/psf/httpbin/pull/51 and https://github.com/python-hyper/brotlicffi/pull/198

@mgorny I've released pytest-httpbin 2.1.0 with the fixes

also bear in mind that some platforms need SO_REUSEPORT_LB eg freebsd

See also https://github.com/twisted/twisted/issues/8207

Would it be better to let people pass a bound and configured socket?

This is failing on Python3.9 because anyio is using asyncio.get_running_loop().create_connection() which in 3.9 didn't delete its reference to `exceptions` I think it should use sock.bind() + asyncio.get_running_loop().sock_connect instead.

Why not use concurrent.futures.ThreadPoolExecutor?

I'll take this out of draft when https://github.com/encode/uvicorn/pull/2435 is in