From 42ae87fe5dad14030e8bcfc6145f88225c3c77d3 Mon Sep 17 00:00:00 2001 From: Randy Frank Date: Mon, 31 Jul 2023 21:57:06 -0400 Subject: [PATCH] Correct for extra slash in input When using os.path.join, the directory name effectively is one char longer. This was correctly handled in the EnSIght interpreter, but not on the pyensight side. --- src/ansys/pyensight/core/session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)