Skip to content

iotiel-sgrun simulator trace function is broken (never ported to python 3) #955

@timburke

Description

@timburke

See:

(env) PS C:\Arch\core\coretools\iotilesensorgraph> iotile-sgrun.exe C:\Users\TimBurke\Desktop\test.sgf -s 'run_time 1 minute' -t C:\Users\TimBurke\Desktop\trace.txt
Traceback (most recent call last):
  File "C:\Arch\core\workspace\env\Scripts\iotile-sgrun-script.py", line 11, in <module>
    load_entry_point('iotile-sensorgraph', 'console_scripts', 'iotile-sgrun')()
  File "c:\arch\core\coretools\iotilesensorgraph\iotile\sg\scripts\iotile_sgrun.py", line 194, in main
    sim.trace.save(args.trace)
  File "c:\arch\core\coretools\iotilesensorgraph\iotile\sg\sim\trace.py", line 52, in save
    json.dump(out, outfile, indent=4)
  File "C:\Python38\lib\json\__init__.py", line 180, in dump
    fp.write(chunk)
TypeError: a bytes-like object is required, not 'str'

The test.sgf was (but it shouldn't matter):

every 1 second
{
        call 0x8000 on controller => unbuffered 2;
        call 0x8002 on controller => unbuffered 2;
}

on value(unbuffered 2) == 5
{
        call 0x8001 on slot 1 => output 1;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions