From 792b725d3775a70e49cc0d53973ed58bc9cf88cd Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Mon, 29 Jan 2024 04:47:07 +0300 Subject: [PATCH] bugfix raising Exceptions when debug=True (#228) --- curl_cffi/curl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curl_cffi/curl.py b/curl_cffi/curl.py index aa2b810f..e88e9021 100644 --- a/curl_cffi/curl.py +++ b/curl_cffi/curl.py @@ -38,7 +38,7 @@ def debug_function(curl, type: int, data, size, clientp) -> int: if type in (CURLINFO_SSL_DATA_IN, CURLINFO_SSL_DATA_OUT): print("SSL OUT", text) elif type in (CURLINFO_DATA_IN, CURLINFO_DATA_OUT): - print(text.decode()) + print(text.decode("utf-8", "replace")) else: print(text.decode(), end="") return 0