The problem occurs when mprof run <command> has multi-line arguments:
For example:
read -r -d '' MESSAGE << EOM
hello
world
EOM
mprof run echo "$MESSAGE"
mprof plot
Using last profile data.
Traceback (most recent call last):
File "/home/stepan/mprof-example/venv/bin/mprof", line 8, in <module>
sys.exit(main())
File "/home/stepan/mprof-example/venv/lib/python3.8/site-packages/mprof.py", line 905, in main
actions[get_action()]()
File "/home/stepan/mprof-example/venv/lib/python3.8/site-packages/mprof.py", line 819, in plot_action
mprofile = plotter(filename, index=n, timestamps=timestamps, options=args)
File "/home/stepan/mprof-example/venv/lib/python3.8/site-packages/mprof.py", line 409, in plot_file
mprofile = read_mprofile_file(filename)
File "/home/stepan/mprof-example/venv/lib/python3.8/site-packages/mprof.py", line 364, in read_mprofile_file
field, value = l.split(' ', 1)
ValueError: not enough values to unpack (expected 2, got 1)
Fix the problem from #210
The problem occurs when
mprof run <command>
has multi-line arguments:For example: