From e237f45be5bf36e391848c499d2e811e73ed7156 Mon Sep 17 00:00:00 2001
From: Leonardo Rochael Almeida <leonardo@nexedi.com>
Date: Tue, 24 Nov 2009 16:55:21 +0000
Subject: [PATCH] Fix for: AttributeError: TimeoutTransport instance has no
 attribute '_use_datetime'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30851 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/Document/OOoDocument.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/product/ERP5OOo/Document/OOoDocument.py b/product/ERP5OOo/Document/OOoDocument.py
index 662ad396b4..0dec8f00f7 100644
--- a/product/ERP5OOo/Document/OOoDocument.py
+++ b/product/ERP5OOo/Document/OOoDocument.py
@@ -65,6 +65,13 @@ class TimeoutTransport(SafeTransport):
   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")
-- 
2.30.9