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

Investigate error handling in copy_directory.py #9600

Closed
berland opened this issue Dec 20, 2024 · 0 comments · Fixed by #9627
Closed

Investigate error handling in copy_directory.py #9600

berland opened this issue Dec 20, 2024 · 0 comments · Fixed by #9627

Comments

@berland
Copy link
Contributor

berland commented Dec 20, 2024

There seems to be an error in the exception handling of copy_directory.py, at least this output was retrieved in an everest test case in the file copy_directory.stderr.0 where the original error (EGG_FLOW.DATA not being present) is correct.

Traceback (most recent call last):
  File "/private/havb/projects/ert/src/ert/resources/shell_scripts/copy_directory.py", line 33, in <module>
    copy_directory(src_path, target_path)
  File "/private/havb/projects/ert/src/ert/resources/shell_scripts/copy_directory.py", line 21, in copy_directory
    shutil.copytree(src_path, target_path, dirs_exist_ok=True)
  File "/usr/lib64/python3.11/shutil.py", line 561, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/shutil.py", line 515, in _copytree
    raise Error(errors)
shutil.Error: [('/private/havb/projects/ert/test-data/everest/egg/everest/model/../../eclipse/include/realizations/realization-0/eclipse/model/EGG_FLOW.DATA', 'eclipse/model/EGG_FLOW.DATA', "[Errno 2] No such file or directory: '/private/havb/projects/ert/test-data/everest/egg/everest/model/../../eclipse/include/realizations/realization-0/eclipse/model/EGG_FLOW.DATA'")]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/havb/projects/ert/src/ert/resources/shell_scripts/copy_directory.py", line 36, in <module>
    f"COPY_DIRECTORY failed with the following error: {''.join(e.args[0])}"
                                                       ^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, tuple found
copy_directory.stderr.0 (END)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant