[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30336] branches/soc-2010-leifandersen/ tests/render/run.py: Getting an IOError 24: Too many files open error when the --with-animations flag is used.

Leif Andersen leif.a.andersen at gmail.com
Wed Jul 14 20:57:01 CEST 2010


Revision: 30336
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30336
Author:   leifandersen
Date:     2010-07-14 20:57:01 +0200 (Wed, 14 Jul 2010)

Log Message:
-----------
Getting an IOError 24: Too many files open error when the --with-animations flag is used.  Which is weird as the only files opened which aren't closed before another one is opened are the images, done with Image.open(), but those don't have a close() method.

Modified Paths:
--------------
    branches/soc-2010-leifandersen/tests/render/run.py

Modified: branches/soc-2010-leifandersen/tests/render/run.py
===================================================================
--- branches/soc-2010-leifandersen/tests/render/run.py	2010-07-14 18:22:39 UTC (rev 30335)
+++ branches/soc-2010-leifandersen/tests/render/run.py	2010-07-14 18:57:01 UTC (rev 30336)
@@ -395,7 +395,7 @@
             good_path = os.path.join(good_folder, string.replace(filename, '.blend', ''))
             test_path = os.path.join(output_folder, string.replace(filename, '.blend', ''))
             test_case = AnimationTestCase()
-            test_case.setup_hash(blend_path, good_path, test_path)
+            test_case.setup_image(blend_path, good_path, test_path)
             cases.append(test_case)
     return cases
 
@@ -461,6 +461,52 @@
         print "Or python --build-tests --with-animations to also build animation tests"
     print 'Check index.html for more information'
 
+def anim_output(animation, output_path):
+    file = open(output_path, "w")
+    (output_directory, output_file) = os.path.split(output_path)
+    file.write('<html><head>\n')
+    file.write('<link rel="stylesheet" href="style.css" type="text/css" />\n')
+    file.write('<title>Render Test Output</title>\n</head>\n')
+    file.write('<body>\n')
+    file.write('<div class="noprint" id="navcontainer"><a href="http://www.blender.org/"><img width="140" height="50" title="blender.org home page" alt="blender.org home page" src="http://www.blender.org/fileadmin/site/_gfx/nav-home.png"></a><a href="http://www.blender.org/features-gallery/"><img width="140" height="50" title="Features & Gallery" alt="Features & Gallery" src="http://www.blender.org/fileadmin/site/_gfx/nav-features.png"></a><a href="http://www.blender.org/download/get-blender/"><img width="140" height="50" title="Download" alt="Download" src="http://www.blender.org/fileadmin/site/_gfx/nav-download.png"></a><a href="http://www.blender.org/education-help/"><img width="140" height="50" title="Tutorials & Help" alt="Tutorials & Help" src="http://www.blender.org/fileadmin/site/_gfx/nav-help.png"></a><a href="http://www.blender.org/community/user-community/"><img width="140" height="50" title="Community" alt="Community" src="http://www.blender.org/fileadmin/site/_gfx/nav-community.png"></a><a href="http://www.blender.org/development/"><img width="140" height="50" title="Development" alt="Development" src="http://www.blender.org/fileadmin/site/_gfx/nav-development-on.png"></a><a href="http://www.blender.org/e-shop/"><img width="140" height="50" title="e-Shop" alt="e-Shop" src="http://www.blender.org/fileadmin/site/_gfx/nav-eshop.png"></a></div> \n')
+    file.write('<div class="document">\n')
+    file.write('<div id="pageheader"></div>\n')
+    file.write('<div class="documentwrapper">\n<div class="bodywrapper">\n<div class="body">\n')
+    file.write('<h1>Animation:' + animation.name + '</h1>\n')
+    file.write('<table border="1">\n')
+    file.write('<tr>\n')
+    file.write('<th>Filename</th>\n')
+    file.write('<th>Good Image</th>\n')
+    file.write('<th>Latest Render</th>\n')
+    file.write('<th>Diff</th>\n')
+    file.write('<th>Match?</th>\n')
+    file.write('</tr>\n')
+
+    i = 1
+    for frame in animation.diff_animation:
+        file.write('<tr>\n')
+        file.write('<td> Frame: ' + str(i) +  '</td>\n')
+        file.write('<td><a href="' + animation.good_path_arr[i-1] + '"><img src="' + animation.good_path_arr[i-1] + '" alt="Good Image" width="200" height="150"></a></td>\n')
+        file.write('<td><a href="' + animation.test_path_arr[i-1] + '"><img src="' + animation.test_path_arr[i-1] + '" alt="Latest Render" width="200" height="150"></a></td>\n')
+        file.write('<td><a href="' + animation.diff_path_arr[i-1] + '"><img src="' + animation.diff_path_arr[i-1] + '" alt="Image Diff" width="200" height="150"></a></td>\n')
+        file.write('<td>')
+        if animation.passed_arr[i-1]:
+            file.write('<font color="ooffoo">OK</font>: ' + str(animation.bad_pixels_arr[i-1]) + ' of ' + str(animation.pixel_count_arr[i-1]) + ' pixels different, ' + str(animation.difference) + '% different.')
+        else:
+            file.write('<font color="ff0000">FAIL</font>: ' + str(animation.bad_pixels_arr[i-1]) + ' of ' + str(animation.pixel_count_arr[i-1]) + ' pixels different, ' + str(animation.difference) + '% different.')
+        if animation.message != None:
+            file.write(" " + animation.message)
+        file.write('</td>\n</tr>\n')
+        i+=1
+
+    file.write('</table>\n')
+    file.write('</div>\n</div>\n</div>\n')
+    file.write('<div class="clearer"></div>\n')
+    file.write('<div class="footer">Render Comparison Tests</div>\n')
+    file.write('</div><b class="round"><b id="r1"></b><b id="r2"></b><b id="r3"></b><b id="r4"></b></b>\n')
+    file.write('</div>\n</body>\n</html>')
+    file.close()
+
 def generate_output(images, output_path):
     ''''''
     file = open(output_path, "w")
@@ -546,52 +592,6 @@
     file.write('</div>\n</body>\n</html>')
     file.close()
 
-def anim_output(animation, output_path):
-    file = open(output_path, "w")
-    (output_directory, output_file) = os.path.split(output_path)
-    file.write('<html><head>\n')
-    file.write('<link rel="stylesheet" href="style.css" type="text/css" />\n')
-    file.write('<title>Render Test Output</title>\n</head>\n')
-    file.write('<body>\n')
-    file.write('<div class="noprint" id="navcontainer"><a href="http://www.blender.org/"><img width="140" height="50" title="blender.org home page" alt="blender.org home page" src="http://www.blender.org/fileadmin/site/_gfx/nav-home.png"></a><a href="http://www.blender.org/features-gallery/"><img width="140" height="50" title="Features & Gallery" alt="Features & Gallery" src="http://www.blender.org/fileadmin/site/_gfx/nav-features.png"></a><a href="http://www.blender.org/download/get-blender/"><img width="140" height="50" title="Download" alt="Download" src="http://www.blender.org/fileadmin/site/_gfx/nav-download.png"></a><a href="http://www.blender.org/education-help/"><img width="140" height="50" title="Tutorials & Help" alt="Tutorials & Help" src="http://www.blender.org/fileadmin/site/_gfx/nav-help.png"></a><a href="http://www.blender.org/community/user-community/"><img width="140" height="50" title="Community" alt="Community" src="http://www.blender.org/fileadmin/site/_gfx/nav-community.png"></a><a href="http://www.blender.org/development/"><img width="140" height="50" title="Development" alt="Development" src="http://www.blender.org/fileadmin/site/_gfx/nav-development-on.png"></a><a href="http://www.blender.org/e-shop/"><img width="140" height="50" title="e-Shop" alt="e-Shop" src="http://www.blender.org/fileadmin/site/_gfx/nav-eshop.png"></a></div> \n')
-    file.write('<div class="document">\n')
-    file.write('<div id="pageheader"></div>\n')
-    file.write('<div class="documentwrapper">\n<div class="bodywrapper">\n<div class="body">\n')
-    file.write('<h1>Animation:' + animation.name + '</h1>\n')
-    file.write('<table border="1">\n')
-    file.write('<tr>\n')
-    file.write('<th>Filename</th>\n')
-    file.write('<th>Good Image</th>\n')
-    file.write('<th>Latest Render</th>\n')
-    file.write('<th>Diff</th>\n')
-    file.write('<th>Match?</th>\n')
-    file.write('</tr>\n')
-
-    i = 1
-    for frame in animation.diff_animation:
-        file.write('<tr>\n')
-        file.write('<td> Frame: ' + str(i) +  '</td>\n')
-        file.write('<td><a href="' + animation.good_path_arr[i-1] + '"><img src="' + animation.good_path_arr[i-1] + '" alt="Good Image" width="200" height="150"></a></td>\n')
-        file.write('<td><a href="' + animation.test_path_arr[i-1] + '"><img src="' + animation.test_path_arr[i-1] + '" alt="Latest Render" width="200" height="150"></a></td>\n')
-        file.write('<td><a href="' + animation.diff_path_arr[i-1] + '"><img src="' + animation.diff_path_arr[i-1] + '" alt="Image Diff" width="200" height="150"></a></td>\n')
-        file.write('<td>')
-        if animation.passed:
-            file.write('<font color="ooffoo">OK</font>: ' + str(animation.bad_pixels) + ' of ' + str(animation.pixel_count) + ' pixels different, ' + str(animation.difference) + '% different.')
-        else:
-            file.write('<font color="ff0000">FAIL</font>: ' + str(animation.bad_pixels) + ' of ' + str(animation.pixel_count) + ' pixels different, ' + str(animation.difference) + '% different.')
-        if animation.message != None:
-            file.write(" " + animation.message)
-        file.write('</td>\n</tr>\n')
-        i+=1
-
-    file.write('</table>\n')
-    file.write('</div>\n</div>\n</div>\n')
-    file.write('<div class="clearer"></div>\n')
-    file.write('<div class="footer">Render Comparison Tests</div>\n')
-    file.write('</div><b class="round"><b id="r1"></b><b id="r2"></b><b id="r3"></b><b id="r4"></b></b>\n')
-    file.write('</div>\n</body>\n</html>')
-    file.close()
-
 def main():
     global BLENDER_BIN, VERBOSE
     BLEND_FILE_FOLDER = os.path.join(sys.path[0])
@@ -626,6 +626,9 @@
 
     BLENDER_BIN = options.blender_bin
     VERBOSE = options.verbose
+    if options.run_animations:
+        VERBOSE = True # Done so the program won't crash, otherwise POpen will complain for some reason.
+        
     if options.building_tests:
         BLENDER_BIN = GOOD_BLENDER_BIN
         OUTPUT_FOLDER = GOOD_FOLDER





More information about the Bf-blender-cvs mailing list