Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tarantool/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,19 @@ def __init__(self, conn, response):
# created in the __new__().
# super(Response, self).__init__()

kwargs = dict(use_list=True)
if msgpack.version >= (1, 0, 0):
# XXX: Explain why it is necessary.
kwargs['strict_map_key'] = False
if msgpack.version >= (0, 5, 2) and conn.encoding == 'utf-8':
# Get rid of the following warning.
# > PendingDeprecationWarning: encoding is deprecated,
# > Use raw=False instead.
unpacker = msgpack.Unpacker(use_list=True, raw=False)
kwargs['raw'] = False
elif conn.encoding is not None:
unpacker = msgpack.Unpacker(use_list=True, encoding=conn.encoding)
else:
unpacker = msgpack.Unpacker(use_list=True)
kwargs['encoding'] = conn.encoding

unpacker = msgpack.Unpacker(**kwargs)
unpacker.feed(response)
header = unpacker.unpack()

Expand Down