datalad / datalad-gooey

A graphical user interface for DataLad (datalad.org)
https://docs.datalad.org/projects/gooey
Other
4 stars 6 forks source link

get rid of lsdir tracebacks? #240

Closed adswa closed 1 year ago

adswa commented 1 year ago

I dropped a hierarchy of datasets ('studyforrest-data') on Windows with datalad-gooey installed from yesterday's installer. Drop failed with what is actually an lsdir error, seemingly arising from ls'ing a directory that was just dropped:

image

I tried it on Linux, too, and on Windows installed from the most recent commit. drop succeeded (no interference from lsdir) and the command log did not show any error, but a similar traceback appeared in the error log:

Running: gooey_lsdir(path=PosixPath('/home/adina/studyforrest-data'), result_renderer='disabled', on_failure='ignore') failed!
Traceback (most recent call last):
  File "/home/adina/repos/datalad-gooey/datalad_gooey/dataladcmd_exec.py", line 159, in _cmdexec_thread
    for res in cmd(**cmdkwargs):
  File "/home/adina/env/gooey/lib/python3.10/site-packages/datalad/interface/utils.py", line 357, in generator_func
    for r in _process_results(
  File "/home/adina/env/gooey/lib/python3.10/site-packages/datalad/interface/utils.py", line 544, in _process_results
    for res in results:
  File "/home/adina/repos/datalad-gooey/datalad_gooey/lsdir.py", line 62, in __call__
    for r in _list(path):
  File "/home/adina/repos/datalad-gooey/datalad_gooey/lsdir.py", line 85, in _list
    yield from _lsfiles(path)
  File "/home/adina/repos/datalad-gooey/datalad_gooey/lsdir.py", line 119, in _lsfiles
    ret = runner.run(
  File "/home/adina/env/gooey/lib/python3.10/site-packages/datalad/runner/runner.py", line 194, in run
    results_or_iterator = self.threaded_runner.run()
  File "/home/adina/env/gooey/lib/python3.10/site-packages/datalad/runner/nonasyncrunner.py", line 320, in run
    return self._locked_run()
  File "/home/adina/env/gooey/lib/python3.10/site-packages/datalad/runner/nonasyncrunner.py", line 368, in _locked_run
    self.process = Popen(self.cmd, **kwargs)         # nosec
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/adina/studyforrest-data'

I wonder whether we should let lsdir write into the Traceback tab?