diff options
author | Joel Challis <git@zvecr.com> | 2023-01-09 08:21:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 08:21:21 +0000 |
commit | 1b045b1e60c2c10178828b20036a3590784bbbfc (patch) | |
tree | 8923a15d3a8332559045e76642faa2cd29342e05 /lib/python | |
parent | cf55032485dd2b3572b78c08a2f30ae510a5fdf0 (diff) |
Handle doctor permission issues while checking udev (#19548)
Diffstat (limited to 'lib/python')
-rw-r--r-- | lib/python/qmk/cli/doctor/linux.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py index a803305c0d..95bafe8c64 100644 --- a/lib/python/qmk/cli/doctor/linux.py +++ b/lib/python/qmk/cli/doctor/linux.py @@ -78,10 +78,13 @@ def check_udev_rules(): # Collect all rules from the config files for rule_file in udev_rules: - for line in rule_file.read_text(encoding='utf-8').split('\n'): - line = line.strip() - if not line.startswith("#") and len(line): - current_rules.add(line) + try: + for line in rule_file.read_text(encoding='utf-8').split('\n'): + line = line.strip() + if not line.startswith("#") and len(line): + current_rules.add(line) + except PermissionError: + cli.log.debug("Failed to read: %s", rule_file) # Check if the desired rules are among the currently present rules for bootloader, rules in desired_rules.items(): |