Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Methodname needs to be str, not bin #46

Open
mbr0wn opened this issue Oct 20, 2017 · 1 comment
Open

Methodname needs to be str, not bin #46

mbr0wn opened this issue Oct 20, 2017 · 1 comment

Comments

@mbr0wn
Copy link
Contributor

mbr0wn commented Oct 20, 2017

OK, #44 fixed blobs, but it broke mprpc in a different way 😢

According to the spec, the method name needs to be a UTF-8 string, not a binary object. If the client is running Python 2, the default string type is binary, and thus msgpack-python will serialize it as such when use_bin_type is set.

I'm not a Cython expert, but it seems like the issue is here:

mprpc/mprpc/client.pyx

Lines 123 to 128 in a7a05e6

def call(self, str method, *args):
"""Calls a RPC method.
:param str method: Method name.
:param args: Method arguments.
"""

The type of method is str, but that's an ambiguous type across Python version boundaries. In Python 2, it'll be binary, in Python 3, it'll be Unicode.

@mbr0wn
Copy link
Contributor Author

mbr0wn commented Oct 20, 2017

#45 is a proposed fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant