intelhex icon indicating copy to clipboard operation
intelhex copied to clipboard

Merge fails on two IntelHex16bit files...

Open thomas-peddle opened this issue 5 years ago • 4 comments

I am reading a PIC16 flash image from the target (oh instance IntelHex16bit), and merging it with a new image (nh instance IntelHex16bit) and get the following error: nh.merge(oh[base:base+size], overlap='replace') File "C:\Users\md84189\AppData\Local\Programs\Python\Python39\lib\site-packages\intelhex_init_.py", line 964, in getitem init.py", line 964, in getitem addr1 = addr16 * 2 TypeError: unsupported operand type(s) for *: 'slice' and 'int'

If both instances are IntelHex or if nh instance is IntelHex and oh remains IntelHex16bit, the operation completes.

Note: Using Python 3.9.0, intelhex-2.3.0

thomas-peddle avatar Nov 13 '20 19:11 thomas-peddle

the problem is not with merge function, but with getitem method (alows to use indexer "[ ]") probably noone used it, therefore never tested properly current implementation doesn't support slicing, and this is what the error really is saying

When I have some time, I will try to propose some fix for that.

fernandez85 avatar Apr 20 '21 21:04 fernandez85