diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-13 13:08:36 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-13 13:08:36 (GMT) |
commit | 7fe04f1dca5820c43416145789f4cc2b94e918b8 (patch) | |
tree | 51ede36f28e31da3bca3e382857259eaff08b094 /Lib/multiprocessing | |
parent | 3be0d0e1f41edaa7e1961b9011338fcf52b327c6 (diff) | |
download | cpython-7fe04f1dca5820c43416145789f4cc2b94e918b8.zip cpython-7fe04f1dca5820c43416145789f4cc2b94e918b8.tar.gz cpython-7fe04f1dca5820c43416145789f4cc2b94e918b8.tar.bz2 |
Issue #21849: Fixed xmlrpclib serialization of non-ASCII unicode strings in
the multiprocessing module.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/connection.py | 4 | ||||
-rw-r--r-- | Lib/multiprocessing/sharedctypes.py | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py index e4d520f..463d472 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -454,10 +454,10 @@ class ConnectionWrapper(object): return self._loads(s) def _xml_dumps(obj): - return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') + return xmlrpclib.dumps((obj,), None, None, None, 1) def _xml_loads(s): - (obj,), method = xmlrpclib.loads(s.decode('utf8')) + (obj,), method = xmlrpclib.loads(s) return obj class XmlListener(Listener): diff --git a/Lib/multiprocessing/sharedctypes.py b/Lib/multiprocessing/sharedctypes.py index 1eb044d..58415fc 100644 --- a/Lib/multiprocessing/sharedctypes.py +++ b/Lib/multiprocessing/sharedctypes.py @@ -46,13 +46,18 @@ __all__ = ['RawValue', 'RawArray', 'Value', 'Array', 'copy', 'synchronized'] # typecode_to_type = { - 'c': ctypes.c_char, 'u': ctypes.c_wchar, + 'c': ctypes.c_char, 'b': ctypes.c_byte, 'B': ctypes.c_ubyte, 'h': ctypes.c_short, 'H': ctypes.c_ushort, 'i': ctypes.c_int, 'I': ctypes.c_uint, 'l': ctypes.c_long, 'L': ctypes.c_ulong, 'f': ctypes.c_float, 'd': ctypes.c_double } +try: + typecode_to_type['u'] = ctypes.c_wchar +except AttributeError: + pass + # # |