From cfd07cc290cc610fceb8d9f025c6bebc1d4b3275 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen Date: Tue, 30 Jun 2020 00:15:22 +0300 Subject: [PATCH] Remove .encode("ascii") call from null byte (#1037) --- httpx/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpx/_utils.py b/httpx/_utils.py index 89ded267..e38a662a 100644 --- a/httpx/_utils.py +++ b/httpx/_utils.py @@ -94,7 +94,7 @@ def format_form_param(name: str, value: typing.Union[str, bytes]) -> bytes: # Null bytes; no need to recreate these on each call to guess_json_utf -_null = "\x00".encode("ascii") # encoding to ASCII for Python 3 +_null = b"\x00" _null2 = _null * 2 _null3 = _null * 3 -- 2.47.3