Skip to content

Commit 8357edb

Browse files
committed
enable binary type for msgpack
Fixes tarantool#105
1 parent ea942f9 commit 8357edb

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ def find_version(*file_paths):
8383
cmdclass=cmdclass,
8484
command_options=command_options,
8585
install_requires=[
86-
'msgpack>=0.4.0',
86+
'msgpack>=1.0.0',
8787
]
8888
)

tarantool/request.py

+1-25
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,7 @@ def __init__(self, conn):
7676
self._sync = None
7777
self._body = ''
7878
self.response_class = Response
79-
80-
packer_kwargs = dict()
81-
82-
# use_bin_type=True is default since msgpack-1.0.0.
83-
#
84-
# The option controls whether to pack binary (non-unicode)
85-
# string values as mp_bin or as mp_str.
86-
#
87-
# The default behaviour of the connector is to pack both
88-
# bytes and Unicode strings as mp_str.
89-
#
90-
# msgpack-0.5.0 (and only this version) warns when the
91-
# option is unset:
92-
#
93-
# | FutureWarning: use_bin_type option is not specified.
94-
# | Default value of the option will be changed in future
95-
# | version.
96-
#
97-
# The option is supported since msgpack-0.4.0, so we can
98-
# just always set it for all msgpack versions to get rid
99-
# of the warning on msgpack-0.5.0 and to keep our
100-
# behaviour on msgpack-1.0.0.
101-
packer_kwargs['use_bin_type'] = False
102-
103-
self.packer = msgpack.Packer(**packer_kwargs)
79+
self.packer = msgpack.Packer()
10480

10581
def _dumps(self, src):
10682
return self.packer.pack(src)

0 commit comments

Comments
 (0)