[issue38837] struct.pack: Unable to pack more than 256 bytes at a time

2019-11-19 Thread Dave Lotton
Dave Lotton added the comment: Mark, you are absolutely correct. I'm an idiot. Focused on wrong thing. Thank you. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue38837] struct.pack: Unable to pack more than 256 bytes at a time

2019-11-18 Thread Mark Dickinson
Mark Dickinson 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 rang

[issue38837] struct.pack: Unable to pack more than 256 bytes at a time

2019-11-18 Thread Dave Lotton
New submission from Dave Lotton : Using struct.pack it is not possible (Python 3.6.8 and 2.7.15) to pack more than 256 bytes at a time. This seems like an arbitrarily small number, and seems to be inconsistent with the capabilities of the unpack function, which is able to unpack a larger n