The to_json method in openlifu.util.json incorrectly uses the Path class. On Windows dirname is always truthy, so to_json creates a directory with the target filename, and then tries to dump the object to the same file-but-actually-a-directory, which results in a PermissionDenied error. Looks to be resolved by setting dirname = Path(filename).parent, (at least on Windows).
The
to_json
method inopenlifu.util.json
incorrectly uses thePath
class. On Windowsdirname
is always truthy, soto_json
creates a directory with the target filename, and then tries to dump the object to the same file-but-actually-a-directory, which results in a PermissionDenied error. Looks to be resolved by settingdirname = Path(filename).parent
, (at least on Windows).