New submission from knzsys:
#Working code:
from struct import *
rawdata = 'A'*196
laserdata = list(unpack('2s2s29H',rawdata[14:76]))
laserdata += list(unpack('26f3L4s',rawdata[76:196]))
#This code generates error:
from str
Changes by knzsys :
--
type: crash -> behavior
___
Python tracker
<http://bugs.python.org/issue30712>
___
___
Python-bugs-list mailing list
Unsubscrib
knzsys added the comment:
#Working code:
from struct import *
rawdata = 'A'*196
laserdata = list(unpack('2s2s29H',rawdata[14:76]))
laserdata += list(unpack('26f3L4s',rawdata[76:196]))
#This code generates error:
from str
knzsys added the comment:
the pack function has the same error: it adds additional 2 bytes
--
___
Python tracker
<http://bugs.python.org/issue30712>
___
___
Pytho
knzsys added the comment:
Thanks a lot.
changing format string from '2s2s29H26f3L4s' to '=2s2s29H26f3L4s' worked for me.
But I still do not understand, why it's working if I splitt format string in 2
parts + use the (un)pack command 2 times ('2s2s29H' +
knzsys added the comment:
just an example, how the pack function behaves with the same format string:
before:
13830108be00cafe3e05ecbc513800043c9be14125359541bf3380447452e041.
after:
13830108be00cafe3e05ecbc513800043c9be14125359541bf3380447452e041
knzsys added the comment:
many many thanks for your help!
and fast responses :-)
this explain my oberservations
why only the first 2 bytes are padded?
0xAABBCCDD (4 bytes = real32) to 0xAABBCCDD (6 bytes)
and not to 0xAABBCCDD (8 bytes)
it has something to do with the behavior of
knzsys added the comment:
Ah OKAY!
That's the key which makes all clear to me!
I didn't thought at that!
Thanks a lot Serhiy Storchaka for your help!
--
___
Python tracker
<http://bugs.python.o