diff --git a/src/ansys/dpf/core/data_sources.py b/src/ansys/dpf/core/data_sources.py index f7f2e952a7b..1283012bf8c 100644 --- a/src/ansys/dpf/core/data_sources.py +++ b/src/ansys/dpf/core/data_sources.py @@ -133,10 +133,11 @@ def set_result_file_path(self, filepath, key=""): >>> data_sources = dpf.DataSources() >>> data_sources.set_result_file_path('/tmp/file.rst') >>> data_sources.result_files - ['/tmp/file.rst'] + ['...tmp...file.rst'] """ - extension = Path(filepath).suffix + filepath = Path(filepath) + extension = filepath.suffix # Handle .res files from CFX if key == "" and extension == ".res": key = "cas" @@ -199,6 +200,7 @@ def set_domain_result_file_path( >>> data_sources.set_domain_result_file_path('/tmp/file1.sub', 1) """ + path = Path(path) if key: self._api.data_sources_set_domain_result_file_path_with_key_utf8( self, str(path), key, domain_id