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

product access should check for broken symbolic links #54

Open
joefutrelle opened this issue Feb 3, 2020 · 1 comment
Open

product access should check for broken symbolic links #54

joefutrelle opened this issue Feb 3, 2020 · 1 comment
Assignees

Comments

@joefutrelle
Copy link
Owner

joefutrelle commented Feb 3, 2020

This appears to primarily be an issue with find_product_file where it assumes that all files returned by os.scandir exist. But os.scandir will list broken symbolic links.

os.scandir returns directory entries, it looks like is_file can be used to determine if a symbolic link is broken.

The desired behavior is to raise a KeyError if the product file is a broken symbolic link, just as if no existing file is found.

@joefutrelle joefutrelle self-assigned this Feb 3, 2020
@joefutrelle
Copy link
Owner Author

Actually it looks like I'm just missing a final test for os.path.exists in some cases. The code assumes that any filename returned by os.scandir points to an existing file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant