I backported xmlrpclib from Python trunk to Python 2.5 to get "connected socket" (HTTP/1.1), which implies to backport also httplib, ssl and socket. It works well. It's *much* faster, eg. 960 ms => 70 ms with HTTPS over a VPN. I just have a little issue: if ServerProxy() URI is an unicode string and an argument is an unicode string (with at least one non-ASCII character), the request fails with: File ".../SVN/python-trunk/Lib/httplib.py", line 784, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 320: ordinal not in range(128) Attached patch includes a test. Can uri contains a login and/or pasword? If yes, should it be encoded to UTF-8 (instead of ASCII)?
Hum, it looks that the issue is not on ServerProxy.__host, but on ServerProxy.__handler. That's why my test uses "http://host:port/RPC2" instead of "http://host:port". In the second case, the handler is set to the default value: "/RPC2" which is str (and not unicode).
Well, it was trivial to workaround this bug in my application (convert host to bytes using explicit host = str(host)). Python3 doesn't have this issue and Python 2.7 is released, I prefer to close this bug as wont fix.
History
Date
User
Action
Args
2022-04-11 14:56:53
admin
set
github: 51342
2010-09-10 22:36:55
vstinner
set
resolution: fixed -> wont fix
2010-09-10 22:36:45
vstinner
set
status: open -> closedresolution: fixedmessages: +