Skip to content

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

@JustAnother1

Description

@JustAnother1

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions