Mark Dickinson <[email protected]> added the comment:
The error you're getting is because you're trying to pack a *value* that's
larger than 255, not because you're trying to pack more than 256 bytes. Packing
more than 256 bytes at a time works fine for me.
>>> packed = struct.pack("<512B", *[n//2 for n in range(512)]) # fine
>>> packed = struct.pack("2B", *[255, 256])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
struct.error: ubyte format requires 0 <= number <= 255
----------
nosy: +mark.dickinson
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38837>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com