nickmckay / LiPD-utilities

Input/output and manipulation utilities for LiPD files in Matlab, R and Python
http://nickmckay.github.io/LiPD-utilities/
GNU General Public License v2.0
29 stars 9 forks source link

Python: reset current working directory in writeLipd() #68

Open CommonClimate opened 4 years ago

CommonClimate commented 4 years ago

the cwd is changed to a temporary one internally, then (normally) restored to the original one. However, this fails if writeLipd() hits a bug in the writing process and exists before restoring. Suggestion: better error handling, making sure cwd is restored no matter what.

chrismheiser commented 4 years ago

I have better error handled and returned to CWD in all the major areas. I'll leave the issue open for now as I'm sure there is further action to take and more spots to check. Hopefully this will cover common occurrences .

oliverbothe commented 3 years ago

The current working directory reset can also be a problem in the R-part of the lipd-utilities when errors occur.