Hi,

> gobject-introspection might fail to generate stuff (failure at
> shutil.rmtree() in gdumpparser.py), especially on slow machines. Re-run
> the build from the last step.
> No new insights into this bug.
> 

Attached is an old patch (I used Dieterv's G-O-I branch) that fixes this mostly 
for me.

>From what I could determine at the time, either the Anti-Virus or some other 
>culprit still had the .exe locked, so the rm failed the first time. Waiting 
>(might make it longer for slower machines) on failure seems to fix it.


Regards,
Martin



Vrywaringsklousule / Disclaimer:  
http://www.nwu.ac.za/it/gov-man/disclaimer.html 

>From 0c9f764be019d25a7ac1274abd16ea05767c3d2a Mon Sep 17 00:00:00 2001
From: Martin Schlemmer <martin.schlem...@nwu.ac.za>
Date: Thu, 12 Jul 2012 12:44:10 +0200
Subject: [PATCH 3/3] Windows port: handle failure to unlink the temporary
 directory more gracefully

On MinGW/MSYS unlinking the temporary directory the first time do not always
succeed the first time because of what seems to be AV-scanner activity on
the created executable. This causes Python to throw an exception, and due to
some strange interaction between MSYS and Python, an artificial lockup is
caused. Pressing return in mintty prints the exception and continues.

This is with Python 2.7 from www.python.org.
---
 giscanner/gdumpparser.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index c0b13f4..ae30e57 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -23,6 +23,7 @@ import sys
 import tempfile
 import shutil
 import subprocess
+import time
 from xml.etree.cElementTree import parse
 
 from . import ast
@@ -171,7 +172,14 @@ blob containing data gleaned from GObject's primitive 
introspection."""
             return parse(out_path)
         finally:
             if not utils.have_debug_flag('save-temps'):
-                shutil.rmtree(self._binary.tmpdir)
+                # FIXME: MinGW/MSYS do not always remove the directory the 
first time,
+                #        causing lockups due to what seems to be interaction 
between
+                #        MSYS and python when an exception is caught ...
+                try:
+                    shutil.rmtree(self._binary.tmpdir)
+                except Exception, e:
+                    time.sleep(0.5)
+                    shutil.rmtree(self._binary.tmpdir, True)
 
     # Parser
 
-- 
1.7.11.msysgit.1

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to