STINNER Victor <victor.stin...@haypocalc.com> added the comment: Here is a patch for httplib encoding HTTP headers to ISO-8859-1, as done in Python 3 (see HTTPConnection.putheader() from http.client). urllib is not affected by this issue because it does already encode Unicode, but encode to ASCII instead of ISO-8859-1.
Related commit in Python 3: changeset: 67720:b3cadf5cf742 user: Armin Ronacher <armin.ronac...@active-4.com> date: Sat Jan 22 13:44:22 2011 +0000 files: Lib/http/client.py Lib/test/test_httpservers.py Misc/NEWS description: To match the behaviour of HTTP server, the HTTP client library now also encodes headers with iso-8859-1 (latin1) encoding. It was already doing that for incoming headers which makes this behaviour now consistent in both incoming and outgoing direction. ---------- keywords: +patch Added file: http://bugs.python.org/file23227/urllib2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12398> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com