Skip to content

Commit

Permalink
Handle doctor permission issues while checking udev (#19548)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Jan 9, 2023
1 parent cf55032 commit 1b045b1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/python/qmk/cli/doctor/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 1b045b1

Please sign in to comment.