[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread knzsys
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

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread knzsys
Changes by knzsys : -- type: crash -> behavior ___ Python tracker <http://bugs.python.org/issue30712> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread knzsys
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

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread knzsys
knzsys added the comment: the pack function has the same error: it adds additional 2 bytes -- ___ Python tracker <http://bugs.python.org/issue30712> ___ ___ Pytho

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread knzsys
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' + &#x

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-20 Thread knzsys
knzsys added the comment: just an example, how the pack function behaves with the same format string: before: 13830108be00cafe3e05ecbc513800043c9be14125359541bf3380447452e041. after: 13830108be00cafe3e05ecbc513800043c9be14125359541bf3380447452e041

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-21 Thread knzsys
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

[issue30712] struct.unpack generates wrong error in certain conditions

2017-06-23 Thread knzsys
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