[Python-ideas] Fall back to encoding unicode strings in utf-8 if latin-1 fails in http.client

Cory Benfield cory at lukasa.co.uk
Thu Jan 7 11:46:50 EST 2016


> On 7 Jan 2016, at 16:32, Guido van Rossum <guido at python.org> wrote:
> 
> Personally I'm perplexed that Requests, which claims to be "HTTP for Humans" doesn't take care of this but just lets http/client.py blow up. (However, IIUC both 2838 and 1822 are about the body.encode() call in Python 3's http/client.py at _send_request(). 1926 seems to originate in Requests itself; it's also Python 2.7.)

The main reason is historical: this was missed in the original (substantial) rewrite in requests 2.0, and as a result we can’t change it without a backward compat break, just the same as Python. We’ll probably fix it in 3.0.

Cory

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160107/b6f67754/attachment.sig>


More information about the Python-ideas mailing list