You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
forrinresp:
ifnotisinstance(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:
forrinresp:
ifnotisinstance(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.
The text was updated successfully, but these errors were encountered:
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: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:In addition, the tests
test_response_with_args()
andtest_async_response_with_args()
use List intest_osc_tcp_server.py
and Tuple intest_osc_server.py
.The text was updated successfully, but these errors were encountered: