[issue26045] Improve error message for http.client when posting unicode string

Martin Panter report at bugs.python.org
Fri Jan 8 19:02:27 EST 2016


Martin Panter added the comment:

Personally I am skeptical if suggesting UTF-8 for the body data is a good idea, but I can go along with it, since other people want it. But I do strongly question whether it is right to suggest UTF-8 for header fields. The RFC <https://tools.ietf.org/html/rfc7230#page-26> only mentions ASCII and Latin-1.

Newer protocols based on HTTP (RTSP comes to mind) do specify UTF-8 for the header, but that is probably out of scope of both the HTTP module and beginner-targetted errors.

If I were redoing this patch, I would drop all the changes except at the body.encode() line in Emil’s original post.

----------
stage:  -> patch review

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26045>
_______________________________________


More information about the Python-bugs-list mailing list