eerimoq / bincopy

Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX, TI-TXT, Verilog VMEM, ELF and binary files).
MIT License
109 stars 38 forks source link

Can't load srec file with python 3.2.1 #11

Closed ghost closed 6 years ago

ghost commented 6 years ago

It is not possible to load a srec file with python 3.2.1:

bincopyfile_obj = bincopy.BinFile()
bincopyfile_obj.add_srec_file(target_path)

The Problem:

    address = int(record[4:4+width], 16)
    data = binascii.unhexlify(record[4 + width:4 + 2 * size - 2]) # Throws Exception: 'str' does not support the buffer interface
    actual_crc = int(record[4 + 2 * size - 2:], 16)

The docs (Python 3.x) of binascii describes the behavior: "a2b_* functions accept Unicode strings containing only ASCII characters. Other functions only accept bytes-like objects (such as bytes, bytearray and other objects that support the buffer protocol)."

eerimoq commented 6 years ago

Python 3.2 reached end-of-life status 2016-02-20. Is there any good reason to support it?