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
Describe the bug
client send_message raise exception when sending blobs
To Reproduce
OSCClient(b'localhost', 10000).send_message(b'/my_uuid', [bytearray(range(16)),])
Expected behavior
16 bytes blob sent to server
Logs/output
Traceback (most recent call last):
File "", line 1, in
File "C:\Utils\Python3\lib\site-packages\oscpy\client.py", line 136, in send_message
stats = send_message(
File "C:\Utils\Python3\lib\site-packages\oscpy\client.py", line 63, in send_message
message, stats = format_message(
File "C:\Utils\Python3\lib\site-packages\oscpy\parser.py", line 271, in format_message
message = pack(
struct.error: pack expected 26 items for packing (got 3)
Platform (please complete the following information):
OS: windows 10
Python 3.7
release
Additional context THE REASON
WRITERS = (
...
(bytearray, (b'b', b'%ib')),
mean
struct.pack(b'16b', bytearray(range(16))) # it is not valid
struct.error: pack expected 16 items for packing (got 1)
FIX
it shoulfd be:
struct.pack(b'16s', bytearray(range(16)))
so,
WRITERS = (
...
(bytearray, (b's', b'%ib')),
The text was updated successfully, but these errors were encountered:
Describe the bug
client send_message raise exception when sending blobs
To Reproduce
OSCClient(b'localhost', 10000).send_message(b'/my_uuid', [bytearray(range(16)),])
Expected behavior
16 bytes blob sent to server
Logs/output
Traceback (most recent call last):
File "", line 1, in
File "C:\Utils\Python3\lib\site-packages\oscpy\client.py", line 136, in send_message
stats = send_message(
File "C:\Utils\Python3\lib\site-packages\oscpy\client.py", line 63, in send_message
message, stats = format_message(
File "C:\Utils\Python3\lib\site-packages\oscpy\parser.py", line 271, in format_message
message = pack(
struct.error: pack expected 26 items for packing (got 3)
Platform (please complete the following information):
Additional context
THE REASON
WRITERS = (
...
(bytearray, (b'b', b'%ib')),
mean
struct.pack(b'16b', bytearray(range(16))) # it is not valid
struct.error: pack expected 16 items for packing (got 1)
FIX
it shoulfd be:
struct.pack(b'16s', bytearray(range(16)))
so,
WRITERS = (
...
(bytearray, (b's', b'%ib')),
The text was updated successfully, but these errors were encountered: