OpenwaterHealth / OpenLIFU-python

focused ultrasound toolbox
GNU Affero General Public License v3.0
12 stars 2 forks source link

to_json fails on windows #168

Closed peterhollender closed 5 days ago

peterhollender commented 6 days ago

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).