'bytearray' object has no attribute 'encode'

Bug #922886 reported by Christopher Wilson on 2012-01-27
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

I'm attempting to program an MSP430F1611 via 'msp430-bsl' and I'm receiving the following error:

$ msp430-bsl --invert-reset --invert-test --swap-reset-test --speed=38400 -r -e -P -p /dev/tty.usbserial-FCV6I5XN null.hex

An error occurred:
'bytearray' object has no attribute 'encode'
Cleaning up after error...

Using 'msp430-bsl.py' from the 'historical' branch of mspgcc project works fine:

$ python msp430-bsl.py --swap-reset-test --invert-reset --invert-test --speed=38400 -c /dev/tty.usbserial-FCV6I5XN -r -e -p null.hex
MSP430 Bootstrap Loader Version: 2.0
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 1.61 (Device ID: f16c)
Changing baudrate to 38400 ...
Program ...
110 bytes programmed.
Reset device ...

I'm running the latest python-msp430-tools (commit 466), but I saw the same behavior on 444.

Any idea what I'm doing wrong or what could cause that error?

Related branches

Changed in python-msp430-tools:
assignee: nobody → zsquareplusc (zsquareplusc)
zsquareplusc (zsquareplusc) wrote :

Yes that was a bug introduced by internal changes to use "bytes" instead of strings to be compatible with python 3.x (2to3).

FYI: you get more detailed error messages with the "--debug" switch.

Changed in python-msp430-tools:
status: New → Fix Committed
importance: Undecided → High
Christopher Wilson (cdwilson) wrote :

Thanks for the fix! The programming works as expected now:

$ msp430-bsl --swap-reset-test --invert-reset --invert-test --speed=38400 -r -e -p /dev/tty.usbserial-FCV6I5XN blink.hex
Programming: OK

Changed in python-msp430-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers