tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
100 stars 48 forks source link

Support msgpack 1.0.0 #156

Closed pcdinh closed 4 years ago

pcdinh commented 4 years ago

In msgpack 1.0.0, the default value of strict_map_key is changed to True to avoid hashdos. However, it will break the Tarantool driver, causing an exception:

ValueError: int is not allowed for map key

As a result, the driver is unable to parse server response. The issue is reported at https://github.com/tarantool/tarantool-python/issues/155

Totktonada commented 4 years ago

In CI:

TypeError: __init__() got an unexpected keyword argument 'strict_map_key'

It seems we should support both old and new implementations.

Totktonada commented 4 years ago

From python-msgpack 1.0.0 release notes:

  • Remove encoding option from the Packer and Unpacker.

Are'we affected by this?

Totktonada commented 4 years ago

From python-msgpack 1.0.0 release notes:

  • Remove encoding option from the Packer and Unpacker.

Are'we affected by this?

In fact, no:

I dived a bit further and it reminds me changes we did for msgpack-0.5.2.

We already use raw=False when encoding is 'utf-8' since msgpack-0.5.2 (2097884), because otherwise it emits the deprecation warning regarding encoding option usage. So we should just continue passing raw=False on msgpack-1.0.0.

Totktonada commented 4 years ago

Closed in favor of PR #173.