diff --git a/src/huggingface_hub/utils/_http.py b/src/huggingface_hub/utils/_http.py index 81923aa577..74513c78c0 100644 --- a/src/huggingface_hub/utils/_http.py +++ b/src/huggingface_hub/utils/_http.py @@ -575,10 +575,10 @@ def _curlify(request: requests.PreparedRequest) -> str: if request.body: body = request.body if isinstance(body, bytes): - body = body.decode("utf-8") + body = body.decode("utf-8", errors="ignore") if len(body) > 1000: body = body[:1000] + " ... [truncated]" - parts += [("-d", body)] + parts += [("-d", body.replace("\n", ""))] parts += [(None, request.url)]