Skip to content
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

Dispatcher replies expect List not Tuple on TCP #176

Open
s0600204 opened this issue Oct 4, 2024 · 0 comments
Open

Dispatcher replies expect List not Tuple on TCP #176

s0600204 opened this issue Oct 4, 2024 · 0 comments

Comments

@s0600204
Copy link

s0600204 commented Oct 4, 2024

According to dispatcher.py lines 104-116, one of the ways a callback function may pass a reply back to a client is by returning a message encapsulated thusly: tuple(<Address>, <ArgValue>).

Actually attempting this with a TCP server results in an error, proclaiming that tuples lack an encode method.

The cause for this error appears to be because the code that handles the reply - found at osc_tcp_server.py lines 78 & 120:

for r in resp:
    if not isinstance(r, list):
        r = [r]

checks if it is encapsulated within a list, not a tuple (and so we end up with r containing [(<Address>, <ArgValue>)]).

The same code in the UDP server - osc_server.py lines 38 & 164 - does check that the reply is encapsulated within a tuple, and thus is conformant to the documentation:

for r in resp:
    if not isinstance(r, tuple):
        r = [r]

In addition, the tests test_response_with_args() and test_async_response_with_args() use List in test_osc_tcp_server.py and Tuple in test_osc_server.py.

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

No branches or pull requests

1 participant