[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55935] trunk/blender/release/scripts/ modules/bpy_extras/io_utils.py: py api: path_reference_copy() use try/ except when copying images, can fail for odd reasons ( currently fails if the dest dir is a symlink and not using expected permissions ).

Campbell Barton ideasman42 at gmail.com
Wed Apr 10 14:16:28 CEST 2013


Revision: 55935
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55935
Author:   campbellbarton
Date:     2013-04-10 12:16:27 +0000 (Wed, 10 Apr 2013)
Log Message:
-----------
py api: path_reference_copy() use try/except when copying images, can fail for odd reasons (currently fails if the dest dir is a symlink and not using expected permissions).

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy_extras/io_utils.py

Modified: trunk/blender/release/scripts/modules/bpy_extras/io_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/io_utils.py	2013-04-10 11:43:25 UTC (rev 55934)
+++ trunk/blender/release/scripts/modules/bpy_extras/io_utils.py	2013-04-10 12:16:27 UTC (rev 55935)
@@ -436,10 +436,20 @@
             pass
         else:
             dir_to = os.path.dirname(file_dst)
-            os.makedirs(dir_to, exist_ok=True)
-            shutil.copy(file_src, file_dst)
 
+            try:
+                os.makedirs(dir_to, exist_ok=True)
+            except:
+                import traceback
+                traceback.print_exc()
 
+            try:
+                shutil.copy(file_src, file_dst)
+            except:
+                import traceback
+                traceback.print_exc()
+
+
 def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."):
     """
     Helper function for storing unique names which may have special characters




More information about the Bf-blender-cvs mailing list