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

Guard directory check call #157

Open
marySalvi opened this issue Sep 28, 2023 · 0 comments
Open

Guard directory check call #157

marySalvi opened this issue Sep 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@marySalvi
Copy link
Collaborator

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.

@marySalvi marySalvi added the bug Something isn't working label Sep 28, 2023
@marySalvi marySalvi self-assigned this Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant