Problem with big int addresses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IntelHex |
Fix Released
|
High
|
Alexander Belchenko |
Bug Description
Reported by e-mail (Dayasagar Patil)
Hi Alexander,
I am using intelhex v1.1 python script (Intel HEX file format reader and converter) developed by you for processing intel hex file.
I use Python v2.5.4.
I observed an issue with the script’s tobinstr() function. This function internally calls tobinarry(), and within tobinarry(), xrange() python api is used.
I think xrange() function does not work for large integers. When I called tobinstr() with large integers as arguments,
the exception ‘OverflowError: long int too large to convert to int’ was raised.
Following is my code snippet:
Ranges = [(2684625744L, 2684625749L)]
Data = ''
for Start, End in Ranges:
Data += Hex.tobinstr(
print Data
I checked with the latest version 1.5 of the intel hex script, but found that it too uses xrange() (inside _tobinarray_
It would be great if you could provide some details on this issue and a solution.
Thanks,
Dayasagar Patil
Related branches
Changed in intelhex: | |
milestone: | 1.5.1 → none |
Changed in intelhex: | |
milestone: | none → 2.0 |
status: | Confirmed → Fix Released |
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 tobinstr( start=0x8000000 0, end=0x80000001)) __init_ _.py", line 381, in tobinstr really( start, end, pad, size) __init_ _.py", line 384, in _tobinstr_really self._tobinarra y_really( start, end, pad, size).tostring()) __init_ _.py", line 357, in _tobinarray_really
Type "help", "copyright", "credits" or "license" for more information.
>>> import intelhex
>>> ih = intelhex.IntelHex()
>>> print(ih.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "intelhex\
return self._tobinstr_
File "intelhex\
return asbytes(
File "intelhex\
for i in range_g(start, end+1):
OverflowError: long int too large to convert to int