Skip to content

Commit

Permalink
Snapshot: don't walk directories without read permissions
Browse files Browse the repository at this point in the history
Original patch by Joshua Skelton (@joshuaskelly) on issue gorakhargosh#408.
  • Loading branch information
BoboTiG committed Jun 11, 2019
1 parent 8b94506 commit cfc12e1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/watchdog/utils/dirsnapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,12 @@ def walk(root):
yield _
if recursive:
for path, st in entries:
if S_ISDIR(st.st_mode):
for _ in walk(path):
yield _
try:
if S_ISDIR(st.st_mode):
for _ in walk(path):
yield _
except PermissionError:
pass

for p, st in walk(path):
i = (st.st_ino, st.st_dev)
Expand Down

0 comments on commit cfc12e1

Please sign in to comment.