Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge fails on two IntelHex16bit files... #51

Open
thomas-peddle opened this issue Nov 13, 2020 · 1 comment
Open

Merge fails on two IntelHex16bit files... #51

thomas-peddle opened this issue Nov 13, 2020 · 1 comment

Comments

@thomas-peddle
Copy link

thomas-peddle commented Nov 13, 2020

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

@fernandez85
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants