The GUI file browser ensures that the files and directories sent in open file requests are real, but this restriction can be bypassed through the scripting interface.
Directories can either be included in the file paths used in a LEL expression, or a base directory can be specified in the directory parameter. If a non-existent directory is used in the expression, the backend fails cleanly and reports that the file doesn't exist, but if the non-existent directory is provided in the directory parameter, the backend crashes, as reported in this PR comment. I have reproduced this on Ubuntu 20.04 (it causes a segmentation fault).
To Reproduce
Steps to reproduce the behavior:
Install the Python wrapper (PR #108 is about to be merged into dev); launch Python3 interpreter
Launch the backend and frontend (>= 4.0 release needed for latest wrapper; enable scripting flag in backend); look in backend terminal output for URL and session ID
from carta.session import Session
session = Session.interact("PUT URL WITH TOKEN HERE", PUT_SESSION_ID_HERE)
img = session.open_LEL_image("any expression, like image1.fits + image2.fits", directory="not_a_real_directory")
Backend will crash. It should not crash if the same bad directory is included in the file path(s) in the expression.
Expected behavior
The backend should fail cleanly and report that the directory does not exist.
Describe the bug
The GUI file browser ensures that the files and directories sent in open file requests are real, but this restriction can be bypassed through the scripting interface.
Directories can either be included in the file paths used in a LEL expression, or a base directory can be specified in the directory parameter. If a non-existent directory is used in the expression, the backend fails cleanly and reports that the file doesn't exist, but if the non-existent directory is provided in the directory parameter, the backend crashes, as reported in this PR comment. I have reproduced this on Ubuntu 20.04 (it causes a segmentation fault).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The backend should fail cleanly and report that the directory does not exist.