1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 17:06:17 +00:00

Scanner: handle permission errors

This commit is contained in:
spl0k 2018-01-20 21:44:20 +01:00
parent 954c75bc35
commit 3fd748cc5a

View File

@ -69,7 +69,13 @@ class Scanner:
scanned = 0
while to_scan:
path = to_scan.pop()
for f in os.listdir(path):
try:
entries = os.listdir(path)
except OSError:
continue
for f in entries:
try: # test for badly encoded filenames
f.encode('utf-8')
except UnicodeError: