Skip to content

Commit 0618951

Browse files
mndevecimilas
andauthored
fix: use response.text to get string rather than bytes (#3156)
Signed-off-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Co-authored-by: Milas Bowman <milas.bowman@docker.com>
1 parent 806d36a commit 0618951

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def create_api_error_from_http_exception(e):
2727
try:
2828
explanation = response.json()['message']
2929
except ValueError:
30-
explanation = (response.content or '').strip()
30+
explanation = (response.text or '').strip()
3131
cls = APIError
3232
if response.status_code == 404:
3333
explanation_msg = (explanation or '').lower()

0 commit comments

Comments
 (0)