[Bf-blender-cvs] [3a58c46] master: Fix addon crash when trying listdir a directory we have no permission to.
Bastien Montagne
noreply at git.blender.org
Wed Jul 30 15:39:01 CEST 2014
Commit: 3a58c4679ae0405ba818d097b3566ca7a332bc0e
Author: Bastien Montagne
Date: Wed Jul 30 15:35:19 2014 +0200
Branches: master
https://developer.blender.org/rB3a58c4679ae0405ba818d097b3566ca7a332bc0e
Fix addon crash when trying listdir a directory we have no permission to.
===================================================================
M release/scripts/modules/bpy/path.py
===================================================================
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index ccc9df9..874efc2 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -219,7 +219,10 @@ def resolve_ncase(path):
# we are expecting 'dirpath' to be a directory, but it could be a file
if _os.path.isdir(dirpath):
- files = _os.listdir(dirpath)
+ try:
+ files = _os.listdir(dirpath)
+ except PermissionError: # We might not have the permission to list dirpath...
+ return path, False
else:
return path, False
More information about the Bf-blender-cvs
mailing list