Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Fix defaults for msgpack-python with respect to blobs
Browse files Browse the repository at this point in the history
msgpack-python defaults to using binary strings, unless an encoding is
specified. In that case, `use_bin_type=True` needs to also be specified
to allow blobs to be serialized as well as strings.

mprpc specifies an encoding, but not `use_bin_type`, which this commit
rectifies. The default setting now allows Unicode strings well as
arbitrary blobs.
  • Loading branch information
mbr0wn committed Oct 18, 2017
1 parent 5aef111 commit 227231f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mprpc/client.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cdef class RPCClient:
self._socket = None
self._tcp_no_delay = tcp_no_delay
self._keep_alive = keep_alive
self._pack_params = pack_params or dict()
self._pack_params = pack_params or dict(use_bin_type=True)
self._unpack_encoding = unpack_encoding
self._unpack_params = unpack_params or dict(use_list=False)

Expand Down
2 changes: 1 addition & 1 deletion mprpc/server.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cdef class RPCServer:

def __init__(self, *args, **kwargs):
pack_encoding = kwargs.pop('pack_encoding', 'utf-8')
pack_params = kwargs.pop('pack_params', dict())
pack_params = kwargs.pop('pack_params', dict(use_bin_type=True))

self._unpack_encoding = kwargs.pop('unpack_encoding', 'utf-8')
self._unpack_params = kwargs.pop('unpack_params', dict(use_list=False))
Expand Down

0 comments on commit 227231f

Please sign in to comment.