From e8585b276fd42d3d964ff3753198aac95bb9037a Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sun, 4 Jan 2026 23:39:55 +0100 Subject: [PATCH] fix typing --- scripts/reproduce_bug_staging.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/reproduce_bug_staging.py b/scripts/reproduce_bug_staging.py index c6e6953f..5c94db03 100644 --- a/scripts/reproduce_bug_staging.py +++ b/scripts/reproduce_bug_staging.py @@ -49,7 +49,12 @@ async def reproduce() -> None: ) as response: print(f"Stream status: {response.status_code}") if response.status_code != 200: - print(f"Error: {await response.aread()}") + err_bytes = await response.aread() + try: + err_str = err_bytes.decode() + except Exception: + err_str = repr(err_bytes) + print(f"Error: {err_str}") return print("Stream started. Reading a few chunks...") @@ -71,7 +76,7 @@ async def reproduce() -> None: print("\nChecking final balance...") try: final_reserved = await get_balance(client) - except Exception: + except Exception as e: # Retry once if connection was closed async with httpx.AsyncClient( base_url=BASE_URL, headers=headers, timeout=30.0