From: Taneli Hukkinen Date: Mon, 29 Jun 2020 21:15:22 +0000 (+0300) Subject: Remove .encode("ascii") call from null byte (#1037) X-Git-Tag: 0.14.0~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfd07cc290cc610fceb8d9f025c6bebc1d4b3275;p=thirdparty%2Fhttpx.git Remove .encode("ascii") call from null byte (#1037) --- 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