Skip to content

curl_httpclient: preserve non-UTF-8 debug messages - #3778

Open
MokiMeow wants to merge 1 commit into
tornadoweb:masterfrom
MokiMeow:fix-curl-debug-non-utf8
Open

MokiMeow wants to merge 1 commit into
tornadoweb:masterfrom
MokiMeow:fix-curl-debug-non-utf8

Conversation

@MokiMeow

@MokiMeow MokiMeow commented Oct 9, 2026 •

Copy link
Copy Markdown

Fixes #3183.

A non-UTF-8 response header makes curl debug logging raise UnicodeDecodeError. Fall back to the original bytes' repr while preserving valid UTF-8 formatting. A real HTTP response and three invalid-byte cases reproduce the failure before the fix.

Linux lint, documentation and both standard/full test environments pass; five configurations each report 1,453 tests. All 71 curl-module tests pass on Linux. The four new Windows methods pass; two existing Windows curl errors also reproduce on unchanged main.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnicodeDecodeError in curl_httpclient's _curl_debug()

1 participant