diff --git a/src/ansys/pyensight/core/session.py b/src/ansys/pyensight/core/session.py index c8ae02ee38e..37fd0023190 100644 --- a/src/ansys/pyensight/core/session.py +++ b/src/ansys/pyensight/core/session.py @@ -439,7 +439,8 @@ def copy_write_function__(filename: str, data: bytes) -> None: out = [] dirlen = 0 if localdir: - dirlen = len(localdir) + # we use dirlen + 1 here to remove the '/' inserted by os.path.join() + dirlen = len(localdir) + 1 for item in filelist: try: name = os.path.join(localdir, item)