[Erp5-report] r27229 - /erp5/trunk/products/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu May 28 10:54:54 CEST 2009


Author: vincent
Date: Thu May 28 10:54:54 2009
New Revision: 27229

URL: http://svn.erp5.org?rev=27229&view=rev
Log:
Get rid of python's xml module AttributeError happening upon interpreter shutdown.

Modified:
    erp5/trunk/products/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py

Modified: erp5/trunk/products/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py?rev=27229&r1=27228&r2=27229&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py [utf8] Thu May 28 10:54:54 2009
@@ -162,6 +162,19 @@
 # SOAPpy says nothing about thread-safeness of parsed WSDL.
 # Be on the safe side by using threading.local as a storage for it.
 wsdl_cache = threading.local()
+
+# XXX: SOAPpy.wstools.WSDLTools.WSDL.__del__ calls unlink on an xml document
+# instance, which happens to fail (AttributeError: NoneType has no attribute
+# 'unlink') somewhere down in xml module. As that unlink is only acting on xml
+# nodes in memory, it's safe to ignore it.
+def WSDL___del__(self):
+  if self.document is not None:
+    unlink = self.document.unlink
+    try:
+      unlink()
+    except AttributeError:
+      pass
+SOAPpy.wstools.WSDLTools.WSDL.__del__ = WSDL___del__
 
 class SOAPWSDLConnection:
   """




More information about the Erp5-report mailing list