When opening a TDMS file with TdmsFile, nitdms raises FileExistsError if the provided path does not exist. This is misleading, because the actual problem is that the file is missing or the relative path resolves incorrectly.
Example:
from nitdms import TdmsFile
tf = TdmsFile("missing_file.tdms")
Expected
Actual
The issue appears to come from this line:
https://github.com/l-johnston/nitdms/blob/master/nitdms/tdsapi.py#L702
Suggested Fix
if not self._file.exists():
raise FileNotFoundError(self._file)
When opening a TDMS file with
TdmsFile,nitdmsraisesFileExistsErrorif the provided path does not exist. This is misleading, because the actual problem is that the file is missing or the relative path resolves incorrectly.Example:
Expected
FileNotFoundErrorActual
FileExistsErrorThe issue appears to come from this line:
https://github.com/l-johnston/nitdms/blob/master/nitdms/tdsapi.py#L702
Suggested Fix