[New-bugs-announce] [issue30712] struct.unpack generates wrong error in certain conditions

knzsys report at bugs.python.org
Tue Jun 20 09:32:47 EDT 2017


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 struct import *
rawdata = 'A'*196
laserdata = list(unpack('2s2s29H26f3L4s',rawdata[14:196]))													# Does not work due to python bug: unpack calculates wrong size 184 (should be 182) from format string and generates error: 

#struct.error: unpack requires a string argument of length 184

----------
components: Interpreter Core
messages: 296425
nosy: knzsys
priority: normal
severity: normal
status: open
title: struct.unpack generates wrong error in certain conditions
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30712>
_______________________________________


More information about the New-bugs-announce mailing list