Skip to content

trace: Fix plotting when no data dir specified

Darryl Green requested to merge github/fork/bjackman/plot-fix-no-dir into master

Created by: bjackman

If the data_dir argument is a singe path element (e.g. just 'trace.dat') then os.path.dirname(data_dir) is ''. When we later attempt to save a plot to a subdirectory we end up adding '/.png' to this empty string, which means we attempt to save a file to the root directory and get a permissions error.

Fix this by just explicitly preventing self.data_dir from being empty.

Merge request reports