[Erp5-report] r45001 jm - in /erp5/trunk/products/ERP5Type: ./ patches/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 1 17:58:32 CEST 2011


Author: jm
Date: Fri Apr  1 17:58:32 2011
New Revision: 45001

URL: http://svn.erp5.org?rev=45001&view=rev
Log:
Add Zope 2.12 monkey-patch to really fix LP #143531

Added:
    erp5/trunk/products/ERP5Type/patches/OFSUninstalled.py
Modified:
    erp5/trunk/products/ERP5Type/ZopePatch.py

Modified: erp5/trunk/products/ERP5Type/ZopePatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ZopePatch.py?rev=45001&r1=45000&r2=45001&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ZopePatch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ZopePatch.py [utf8] Fri Apr  1 17:58:32 2011
@@ -51,6 +51,7 @@ from Products.ERP5Type.patches import CM
 from Products.ERP5Type.patches import CMFCoreSkinsTool
 from Products.ERP5Type.patches import CMFBTreeFolder
 from Products.ERP5Type.patches import OFSFolder
+from Products.ERP5Type.patches import OFSUninstalled
 from Products.ERP5Type.patches import PersistentMapping
 from Products.ERP5Type.patches import DateTimePatch
 from Products.ERP5Type.patches import PythonScript

Added: erp5/trunk/products/ERP5Type/patches/OFSUninstalled.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/OFSUninstalled.py?rev=45001&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/OFSUninstalled.py (added)
+++ erp5/trunk/products/ERP5Type/patches/OFSUninstalled.py [utf8] Fri Apr  1 17:58:32 2011
@@ -0,0 +1,43 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# Copyright (c) 2010 Nexedi SARL and Contributors. All Rights Reserved.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
+
+# See https://launchpad.net/bugs/143531
+
+from OFS import Uninstalled
+
+if '__getstate__' not in Uninstalled.BrokenClass.__dict__:
+
+  from ZODB.broken import persistentBroken, PersistentBroken
+  from persistent import Persistent
+  from threading import RLock
+  Uninstalled.broken_klasses_lock = lock = RLock()
+  Uninstalled_Broken = Uninstalled.Broken
+  cache = Uninstalled.broken_klasses
+
+  def Broken(self, oid, pair):
+    lock.acquire()
+    try:
+      cached = pair in cache
+      result = Uninstalled_Broken(self, oid, pair)
+      if not cached:
+        klass = cache.pop(pair)
+        assert not issubclass(klass, PersistentBroken), \
+          "This monkey-patch is not useful anymore"
+        cache[pair] = persistentBroken(klass)
+    finally:
+      lock.release()
+    return result
+
+  Uninstalled.Broken = Broken



More information about the Erp5-report mailing list