diff options
author | Robin Jarry <robin.jarry@6wind.com> | 2017-05-23 15:24:07 +0200 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2017-05-24 06:48:06 +0100 |
commit | 5e3b234c30de9115845e41f1150d8729bc44d52e (patch) | |
tree | 412519fb0942b729dd4c96b83cdb29dea2abf9fb /tools/docker | |
parent | 08b211519826febcdba7714ffd5d6fa80282a0c2 (diff) | |
download | patchwork-5e3b234c30de9115845e41f1150d8729bc44d52e.tar patchwork-5e3b234c30de9115845e41f1150d8729bc44d52e.tar.gz |
pwclient: Force xmlrpc client to return unicode strings
On python 2, the reference implementation of the XML-RPC unmarshaller
decodes strings to unicode with the selected encoding (utf-8 by default)
but it tries to re-encode the unicode strings to ascii bytes before
returning the values. If it fails, it leaves the value as unicode.
See these links for more details:
https://hg.python.org/cpython/file/2.7/Lib/xmlrpclib.py#l878
https://hg.python.org/cpython/file/2.7/Lib/xmlrpclib.py#l180
https://hg.python.org/cpython/file/3.6/Lib/xmlrpc/client.py#l753
Monkey-patch the internal xmlrpclib._stringify() function only on python
2 to force it to preserve unicode strings. This allows to have similar
behaviour in both python 2 and python 3.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'tools/docker')
0 files changed, 0 insertions, 0 deletions