From 843346fc98e062a7b0be0835cd055d9d11d2b175 Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Sat, 7 Feb 2026 19:40:10 -0800 Subject: [PATCH] Fix line length in error message --- httpx/_content.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/httpx/_content.py b/httpx/_content.py index e3bdae94..0c80ab9d 100644 --- a/httpx/_content.py +++ b/httpx/_content.py @@ -208,9 +208,11 @@ def encode_request( # Check if it's a list/tuple of bytes for item in data: if not isinstance(item, (bytes, bytearray, memoryview)): + item_type = type(item).__name__ raise TypeError( - f"Expected bytes-like object in 'data' sequence, got {type(item).__name__}. " - f"Use 'json=' for JSON data or 'data={{...}}' for form data." + f"Expected bytes-like object in 'data' sequence, " + f"got {item_type}. Use 'json=' for JSON data or " + f"'data={{...}}' for form data." ) message = "Use 'content=<...>' to upload raw bytes/text content."