microchip-pic-avr-tools / pymcuprog

a Python utility for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers
MIT License
96 stars 22 forks source link

pymcuprog.pymcuprog_main - ERROR - Operation failed with TypeError: a bytes-like object is required, not 'list' #19

Closed kazkansouh closed 2 years ago

kazkansouh commented 2 years ago

I have observed the following:

$ pymcuprog -i updi -d atmega4809 --tool uart --uart /dev/ttyUSB0 read -m fuses -f fuses
Pinging device...
Ping response: 1E9651
Reading...
pymcuprog.pymcuprog_main - ERROR - Operation failed with TypeError: a bytes-like object is required, not 'list'
Done.

I believe the following line is at fault:

https://github.com/microchip-pic-avr-tools/pymcuprog/blob/a9411a8e4a5db8b54517c51da0bae96bf8385a65/pymcuprog/pymcuprog_main.py#L224

It should include a cast and be written as:

data = bytes(item.data)
xedbg commented 2 years ago

Thanks @kazkansouh Logged internally as DSG-4488. Will take a look!

xedbg commented 2 years ago

fixed in 3.13