Skip to content

Commit 17de9a5

Browse files
committed
Eliminate deprecation warning re use_bin_type
When 'use_bin_type' option is not set explicitly, msgpack-0.5.0 (and only it, not 0.5.1 or newer) warns a user that its default value will be changed in a future. The main reason of the change is to allow test_03_discovery_bad_good_addresses() test from test_mesh.py to pass on msgpack-0.5.0: it counts deprecation warnings produced by a call and so affected if unexpected warnings are emitted. This commit is prerequisite to enable msgpack-0.5.0 in CI, which is done in the next commit. Follows up #155
1 parent 81d5253 commit 17de9a5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tarantool/request.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,19 @@ def __init__(self, conn):
7474
#
7575
# The default behaviour of the connector is to pack both
7676
# bytes and Unicode strings as mp_str.
77-
if msgpack.version >= (1, 0, 0):
78-
packer_kwargs['use_bin_type'] = False
77+
#
78+
# msgpack-0.5.0 (and only this version) warns when the
79+
# option is unset:
80+
#
81+
# | FutureWarning: use_bin_type option is not specified.
82+
# | Default value of the option will be changed in future
83+
# | version.
84+
#
85+
# The option is supported since msgpack-0.4.0, so we can
86+
# just always set it for all msgpack versions to get rid
87+
# of the warning on msgpack-0.5.0 and to keep our
88+
# behaviour on msgpack-1.0.0.
89+
packer_kwargs['use_bin_type'] = False
7990

8091
self.packer = msgpack.Packer(**packer_kwargs)
8192

0 commit comments

Comments
 (0)