Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct for extra slash in input #266

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Conversation

randallfrank
Copy link
Collaborator

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.

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.
@randallfrank
Copy link
Collaborator Author

Fixes this bug:

with open("test_exec_run_script.py", "w") as _file:

    _file.write("")

session.copy_to_session(

    pathlib.Path(os.path.abspath("test_exec_run_script.py")).parents[0].as_uri(),

    ["test_exec_run_script.py"],

    remote_prefix="files",

    progress=True

)

Traceback (most recent call last):
File "D:\pyansys\pyensight\tests\example_tests\test_coverage_increase.py", line 22, in test_coverage_increase
session.copy_to_session(
File "D:\pyansys\pyensight.venv\Lib\site-packages\ansys\pyensight\core\session.py", line 471, in copy_to_session
with open(filename, "rb") as fp:
^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'D:\test_exec_run_script.py'

@randallfrank
Copy link
Collaborator Author

randallfrank commented Aug 1, 2023

The builds look like an issue with the license check for the typing modules???

@mariostieriansys mariostieriansys enabled auto-merge (squash) August 1, 2023 12:44
@mariostieriansys mariostieriansys merged commit 2a5bc26 into main Aug 1, 2023
18 checks passed
@mariostieriansys mariostieriansys deleted the fix/copy_to_session_dirlen branch August 1, 2023 16:29
mariostieriansys added a commit that referenced this pull request Aug 2, 2023
Co-authored-by: Mario Ostieri <107915956+mariostieriansys@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants