Empty hex files cause tobinarray to always return empty arrays

Bug #372620 reported by sneakypete
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
IntelHex
Fix Released
Medium
Alexander Belchenko

Bug Description

1) Load an empty file: (eg. file containing just ":00000001FF")
ih = IntelHex(filename)

2) Call "tobinarray"
print ih.tobinarray(0, 2)

This returns array('B') but should return array('B', [255, 255, 255])

3) Add a single data element and try again:
ih[0] = 255
print ih.tobinarray(0, 2)

This correctly returns array('B', [255, 255, 255])

Related branches

Revision history for this message
Alexander Belchenko (bialix) wrote :

Yes, this is the bug, because you explicitly specify the address range.

But in the case when address range is not specified or open-ended IntelHex still should return empty array.

Changed in intelhex:
importance: Undecided → Medium
status: New → Confirmed
Changed in intelhex:
assignee: nobody → Alexander Belchenko (bialix)
milestone: none → 1.2
status: Confirmed → Fix Committed
Changed in intelhex:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.