Skip to content

Guard directory check call #157

@marySalvi

Description

@marySalvi

When we check if files are directories (and possibly elsewhere), we should guard that call. I had a dead mount point that caused the program to crash. This would probably be change from

self.child_directories = [
            child for child in directory.iterdir() if child.is_dir() and os.access(child, os.R_OK)
        ]

to

self.child_directories = []
for child in directory.iterdir():
    try:
        if child.is_dir() and os.access(child, os.R_OK):
            self._child_directories.append(child)
    except Exception OSError:
        pass

more generally, we should guard exceptions so as to keep the gui running.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions