Skip to content

Commit

Permalink
Merge pull request #471 from krathjen/fix-windows-share-scandir
Browse files Browse the repository at this point in the history
Fix network share failures on localized windows systems
  • Loading branch information
kalemas authored Sep 4, 2024
2 parents d834a92 + 2acf25b commit 0281801
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/studiolibrary/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,10 +1252,11 @@ def walkup(path, match=None, depth=3, sep="/"):
except PermissionError:
continue # expected on network shares
except OSError as e:
if 'unexpected network error' in e.strerror:
continue # expected on network shares
if 'handle is invalid' in e.strerror:
continue # something weird on network share
if getattr(e, 'winerror', None) == 59:
continue # "An unexpected network error occurred"
if getattr(e, 'winerror', None) == 6:
# "The handle is invalid" - something weird on network share
continue
raise
for filename in filenames:
path = os.path.join(folder, filename)
Expand Down

0 comments on commit 0281801

Please sign in to comment.