From a6c3d24393de48864cd8707f63f94227d8f1d00c Mon Sep 17 00:00:00 2001 From: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:22:37 -0700 Subject: [PATCH] fix: use response.text to get string rather than bytes Signed-off-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> --- docker/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/errors.py b/docker/errors.py index 8cf8670ba..75e30a8c9 100644 --- a/docker/errors.py +++ b/docker/errors.py @@ -27,7 +27,7 @@ def create_api_error_from_http_exception(e): try: explanation = response.json()['message'] except ValueError: - explanation = (response.content or '').strip() + explanation = (response.text or '').strip() cls = APIError if response.status_code == 404: explanation_msg = (explanation or '').lower()