Repository navigation
startup: Skip unreadable database search directories - #8070
Merged
cwhite911 merged 8 commits intoDec 5, 2026
Merged
Conversation
Refs OSGeo#8027. No source or test changes. AI assistance was used for the issue analysis and draft.
Contributor
Author
|
Hi, just following up on this PR. The checks are passing now. Could you review and merge it if everything looks good? Happy to make any changes needed. Thanks! |
cwhite911
requested changes
Oct 22, 2026
cwhite911
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR! I've suggested a few minor improvements, but otherwise this looks good to me.
Contributor
Author
|
Thanks for the review! I replaced the nested try/except blocks with contextlib.suppress. The unreadable-directory test now checks only PermissionError. I also changed deny_listing to patch Path.iterdir directly instead of os.scandir and os.listdir. |
cwhite911
reviewed
Nov 23, 2026
cwhite911
approved these changes
Dec 2, 2026
cwhite911
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
AI picked up two other issues that could be continued as follow up PRs. See details below.
Details
Two minor points, neither blocking:- Folder choice can be arbitrary (data.py:44, an old problem the PR keeps). Any folder whose name contains "grassdata" counts as a match, and the first one listed wins. If both ~/grassdata and ~/grassdata_old_backup exist, which one is suggested depends on the order the filesystem lists them. The new test has to sort the entries to get a stable result, which shows the problem. A follow-up fix would prefer an exact, case-insensitive grassdata match, then fall back to partial matches in sorted order.
- An error partway through a listing skips the rest of that folder (data.py:49). The except OSError: continue wraps the whole loop over a folder's contents. If an I/O error happens before the grassdata entry is reached (say, on a network-mounted home folder), the match is missed. This is probably fine because a failed listing usually can't be resumed, but a short comment noting the limit would help.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GRASS now skips unreadable directories instead of crashing at startup. The existing search order and fallback stay the same.
Added tests for permission errors and database discovery.
Fixes #8027