-
Notifications
You must be signed in to change notification settings - Fork 46
New python-msgpack version brokes connector #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I got the same issue in Ubuntu 18.04, Python 3.8.2, Tarantool 0.6.6 |
Should be fixed with PR #156. |
Since msgpack 1.0.0 was released Unpacker does not have strict_map_key param and it is True by default now. It makes the Connector fail with an error: `ValueError: int is not allowed for map key` To solve this issue the __init__ method of the Response object was refactored and the strict_map_key param is added for versions less than 1.0.0 Fixes #155
In the new release of msgpack also encoding parameter was removed.
@Totktonada suggested If the encoding option is given to the connector, then you can programmatically go through recursively and do .decode (encoding = 'utf-8') for all bytes (Python 3) or str (Python 2) values. It seems like this should work, and fully transparently support everything that was previously supported: Python 2:
Python 3:
|
I dived a bit further and it reminds me changes we did for msgpack-0.5.2. We already use |
We will need a bit more logic in unpacker configuration code to support msgpack-1.0.0, so it is convenient to factor out it from actual creation of the unpacker instance. No behaviour is changed here. Part of #155
msgpack-1.0.0 changes default value of 'raw' and 'strict_map_key' options. We should handle different versions of the library and provide the same behaviour across them. This version of the msgpack library also drops support of 'encoding' option. We already use raw=True/False msgpack option to implement encoding=None/'utf-8' connector option, so the only change we should do about this is to explicitly forbid other encoding values. Unlikely using of text encodings other than UTF-8 is popular. Part of #155
We'll need to tune msgpack options in order to support msgpack-1.0.0 and it is convenient to do so in one place. Aside of this, reusing of an msgpack.Packer() instance looks good for performance matters, however I guess that an actual difference is negligible. No behaviour is changed. Part of #155
The default value of the 'use_bin_type' option was changed in msgpack-1.0.0. We should support different versions of the library and provide the same behaviour across them. Aside of this, 'encoding' option was dropped since this version of the msgpack library, but we didn't actually support it for packing. Binary strings are packed as is, Unicode strings are encoded as UTF-8 and nothing is changed regarding this. Fixes #155
We will need a bit more logic in unpacker configuration code to support msgpack-1.0.0, so it is convenient to factor out it from actual creation of the unpacker instance. No behaviour is changed here. Part of #155
msgpack-1.0.0 changes default value of 'raw' and 'strict_map_key' options. We should handle different versions of the library and provide the same behaviour across them. This version of the msgpack library also drops support of 'encoding' option. We already use raw=True/False msgpack option to implement encoding=None/'utf-8' connector option, so the only change we should do about this is to explicitly forbid other encoding values. Unlikely using of text encodings other than UTF-8 is popular. Part of #155
We'll need to tune msgpack options in order to support msgpack-1.0.0 and it is convenient to do so in one place. Aside of this, reusing of an msgpack.Packer() instance looks good for performance matters, however I guess that an actual difference is negligible. No behaviour is changed. Part of #155
The default value of the 'use_bin_type' option was changed in msgpack-1.0.0. We should support different versions of the library and provide the same behaviour across them. Aside of this, 'encoding' option was dropped since this version of the msgpack library, but we didn't actually support it for packing. Binary strings are packed as is (as mp_str), Unicode strings are encoded as UTF-8 (as mp_str too) and nothing is changed regarding this. Fixes #155
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
We will need a bit more logic in unpacker configuration code to support msgpack-1.0.0, so it is convenient to factor out it from actual creation of the unpacker instance. No behaviour is changed here. Part of #155
msgpack-1.0.0 changes default value of 'raw' and 'strict_map_key' options. We should handle different versions of the library and provide the same behaviour across them. This version of the msgpack library also drops support of 'encoding' option. We already use raw=True/False msgpack option to implement encoding=None/'utf-8' connector option, so the only change we should do about this is to explicitly forbid other encoding values. Unlikely using of text encodings other than UTF-8 is popular. Part of #155
We'll need to tune msgpack options in order to support msgpack-1.0.0 and it is convenient to do so in one place. Aside of this, reusing of an msgpack.Packer() instance looks good for performance matters, however I guess that an actual difference is negligible. No behaviour is changed. Part of #155
The default value of the 'use_bin_type' option was changed in msgpack-1.0.0. We should support different versions of the library and provide the same behaviour across them. Aside of this, 'encoding' option was dropped since this version of the msgpack library, but we didn't actually support it for packing. Binary strings are packed as is (as mp_str), Unicode strings are encoded as UTF-8 (as mp_str too) and nothing is changed regarding this. Fixes #155
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
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. I choose versions for testing this way: we have 0.4.0 in requirements.txt, so it is the baseline. We should test at least 0.4.0, 0.5.0, 0.6.0 and 1.0.0. I also added 0.6.2, because this version is installed on my Gentoo box and because it is the last release before 1.0.0. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
We will need a bit more logic in unpacker configuration code to support msgpack-1.0.0, so it is convenient to factor out it from actual creation of the unpacker instance. No behaviour is changed here. Part of #155
msgpack-1.0.0 changes default value of 'raw' and 'strict_map_key' options. We should handle different versions of the library and provide the same behaviour across them. This version of the msgpack library also drops support of 'encoding' option. We already use raw=True/False msgpack option to implement encoding=None/'utf-8' connector option, so the only change we should do about this is to explicitly forbid other encoding values. Unlikely using of text encodings other than UTF-8 is popular. Part of #155
We'll need to tune msgpack options in order to support msgpack-1.0.0 and it is convenient to do so in one place. Aside of this, reusing of an msgpack.Packer() instance looks good for performance matters, however I guess that an actual difference is negligible. No behaviour is changed. Part of #155
The default value of the 'use_bin_type' option was changed in msgpack-1.0.0. We should support different versions of the library and provide the same behaviour across them. Aside of this, 'encoding' option was dropped since this version of the msgpack library, but we didn't actually support it for packing. Binary strings are packed as is (as mp_str), Unicode strings are encoded as UTF-8 (as mp_str too) and nothing is changed regarding this. Fixes #155
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
Also bump msgpack PyPI package name in requirements.txt. See the note about the library name change in [1]: | Package name on PyPI was changed to msgpack from 0.5. I choose versions for testing this way: we have 0.4.0 in requirements.txt, so it is the baseline. We should test at least 0.4.0, 0.5.0, 0.6.0 and 1.0.0. I also added 0.6.2, because this version is installed on my Gentoo box and because it is the last release before 1.0.0. [1]: https://github.com/msgpack/msgpack-python/blob/8fb709f2e0438862020d8810fa70a81fb5dac7d4/README.md Follows up #155
In short, the msgpack library changes its name and now offered as 'msgpack' rather than 'msgpack-python'. All new versions of the library are shipped under the new name, so we should change our dependency information. See commit 148d12e ('travis-ci: verify different msgpack library versions') for details. Follows up #155
In short, the msgpack library changes its name and now offered as 'msgpack' rather than 'msgpack-python'. All new versions of the library are shipped under the new name, so we should change our dependency information. See commit 148d12e ('travis-ci: verify different msgpack library versions') for details. Follows up #155
New version of python-msgpack library was released which enforce only string keys in map by default.
This change brokes whole connector because version of python msgpack library is not enforced in requirements.
Commit msgpack/msgpack-python@d8e3cf0
Error on connection to tarantool:
The text was updated successfully, but these errors were encountered: