From 0071d4e135f2937d9fd1ce73ecee6491465f9ee8 Mon Sep 17 00:00:00 2001 From: Gautam Kumar Date: Tue, 16 Jun 2026 23:50:58 +0530 Subject: [PATCH] fix: normalize empty reason phrase to None in asyncio transport The asyncio HTTP client was reporting an empty reason phrase as an empty string instead of None, inconsistent with the requests and httpx transports which normalize empty reason phrases to None. Changed the one-liner to coerce empty string to None so that Response.reason is consistent across all adapters. --- .../src/dexpace/sdk/http/stdlib/asyncio_http_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dexpace-sdk-http-stdlib/src/dexpace/sdk/http/stdlib/asyncio_http_client.py b/packages/dexpace-sdk-http-stdlib/src/dexpace/sdk/http/stdlib/asyncio_http_client.py index cda3831..8d24671 100644 --- a/packages/dexpace-sdk-http-stdlib/src/dexpace/sdk/http/stdlib/asyncio_http_client.py +++ b/packages/dexpace-sdk-http-stdlib/src/dexpace/sdk/http/stdlib/asyncio_http_client.py @@ -232,7 +232,7 @@ async def _read( raise ServiceResponseError(f"Malformed status line: {status_line!r}") protocol = _PROTOCOL_BY_VERSION.get(parts[0], Protocol.HTTP_1_1) status = _parse_status(parts[1]) - reason = parts[2] if len(parts) > 2 else None + reason = (parts[2] or None) if len(parts) > 2 else None headers = await self._read_headers(reader) body_bytes = await self._read_body(reader, headers) return AsyncResponse(