tinyfpga/TinyFPGA-Bootloader

TypeError: the JSON object must be str, not 'bytes'

JustAnother1 opened this issue · 1 comments

When following the getting started guide I run into an issue:

 $ tinyprog --update-bootloader

    TinyProg CLI
    ------------
    Using device id 1d50:6130
    Only one board with active bootloader, using it.
Traceback (most recent call last):
  File "/usr/local/bin/tinyprog", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/tinyprog/__main__.py", line 314, in main
    perform_bootloader_update(port)
  File "/usr/local/lib/python3.5/dist-packages/tinyprog/__main__.py", line 128, in perform_bootloader_update
    bootloader_update_info = json.loads(urlopen(m[u"bootmeta"][u"update"] + "/bootloader.json").read())
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

But this works:

$ tinyprog -p hardware.bin

    TinyProg CLI
    ------------
    Using device id 1d50:6130
    Only one board with active bootloader, using it.
    Programming /dev/ttyACM0 with hardware.bin
    Programming at addr 028000
    Waking up SPI flash
    135100 bytes to program
    Erasing: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 135k/135k [00:01<00:00, 132kB/s]
    Writing: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 135k/135k [00:00<00:00, 182kB/s]
    Reading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 135k/135k [00:00<00:00, 431kB/s]
    Success!

Just a +1 from me.
The --update-bootloader fails for me as described above.
But flashing with -p fails.
System is Ubuntu 16.04, tinyprog installed with pip3 --user.