[Erp5-report] r30851 - /erp5/trunk/products/ERP5OOo/Document/OOoDocument.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 24 17:55:24 CET 2009


Author: leonardo
Date: Tue Nov 24 17:55:21 2009
New Revision: 30851

URL: http://svn.erp5.org?rev=30851&view=rev
Log:
Fix for: AttributeError: TimeoutTransport instance has no attribute '_use_datetime'

Modified:
    erp5/trunk/products/ERP5OOo/Document/OOoDocument.py

Modified: erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/Document/OOoDocument.py?rev=30851&r1=30850&r2=30851&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] Tue Nov 24 17:55:21 2009
@@ -65,6 +65,13 @@
   def __init__(self, timeout=None, scheme='http'):
     self._timeout = timeout
     self._scheme = scheme
+    # On Python 2.6, .__init__() of Transport and SafeTransport must be called
+    # to set up the ._use_datetime attribute.
+    # sigh... too bad we can't use super() here, as SafeTransport is not
+    # a new-style class (as of Python 2.4 to 2.6)
+    # remove the gettattr below when we drop support for Python 2.4
+    super__init__ = getattr(SafeTransport, '__init__', lambda self: None)
+    super__init__(self)
 
   def send_content(self, connection, request_body):
     connection.putheader("Content-Type", "text/xml")




More information about the Erp5-report mailing list