[issue5314] http client error

2009-03-27 Thread Jeremy Hylton
Jeremy Hylton added the comment: Committed revision 70638. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue5314] http client error

2009-03-27 Thread Jeremy Hylton
Jeremy Hylton added the comment: Ok. Discovered that RFC 2616 says that iso-8859-1 is the default charset, so I will use that to encode strings instead of ascii. If you want utf-8, you could encode the string yourself before calling request(). Presumably, you should also add a content-type th

[issue5314] http client error

2009-03-27 Thread Jeremy Hylton
Jeremy Hylton added the comment: The documentation is pretty vague on this point. If you send something other than plain ascii, it gets a bit tricky to figure out what other headers need to be added. It would be safer for the client to pick an encoding (e.g. utf-8) and encode the string before

[issue5314] http client error

2009-03-26 Thread Jeremy Hylton
Jeremy Hylton added the comment: I'm not sure what to do here. I guess changing to utf-8 is safe insofar as the current code only accepts ascii, so the only code that breaks will be code that depends on the encode() call raising an exception. It seems like the client out to specify the encodin

[issue5314] http client error

2009-02-19 Thread cober J
New submission from cober J : Try to use http to send multi-byte utf8 data. File "E:\DEVELOP\python\lib\http\client.py", line 904, in _send_request self.endheaders(body.encode('ascii')) UnicodeEncodeError: 'ascii' codec can't encode character '\u7231' in position 119: ordinal not in range(1