mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-12 21:22:17 +00:00
Scanner: handle permission errors
This commit is contained in:
parent
954c75bc35
commit
3fd748cc5a
@ -69,7 +69,13 @@ class Scanner:
|
|||||||
scanned = 0
|
scanned = 0
|
||||||
while to_scan:
|
while to_scan:
|
||||||
path = to_scan.pop()
|
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
|
try: # test for badly encoded filenames
|
||||||
f.encode('utf-8')
|
f.encode('utf-8')
|
||||||
except UnicodeError:
|
except UnicodeError:
|
||||||
|
Loading…
Reference in New Issue
Block a user