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

Methodname needs to be str, not bin #46

@mbr0wn

Description

@mbr0wn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions