[Checkins] SVN: zope.component/trunk/ Fix bug introduced in 3.5.0: <utility factory="..."> no longer supported

Marius Gedminas marius at pov.lt
Fri Jul 25 12:15:42 EDT 2008


Log message for revision 88820:
  Fix bug introduced in 3.5.0: <utility factory="..."> no longer supported
  interfaces declared in Python and always wanted an explicit provides="..."
  attribute. https://bugs.launchpad.net/zope3/+bug/251865
  
  I think this is important enough to warrant a 3.5.1 bugfix release ASAP, seeing
  as to how it broke ftests in probably all of zope.app.*.
  
  

Changed:
  U   zope.component/trunk/README.txt
  U   zope.component/trunk/setup.py
  U   zope.component/trunk/src/zope/component/zcml.py
  U   zope.component/trunk/src/zope/component/zcml.txt

-=-
Modified: zope.component/trunk/README.txt
===================================================================
--- zope.component/trunk/README.txt	2008-07-25 16:09:48 UTC (rev 88819)
+++ zope.component/trunk/README.txt	2008-07-25 16:15:42 UTC (rev 88820)
@@ -16,6 +16,13 @@
 
 ...
 
+3.5.1 (2008-07-25)
+==================
+
+Fix bug introduced in 3.5.0: <utility factory="..."> no longer supported
+interfaces declared in Python and always wanted an explicit provides="..."
+attribute. https://bugs.launchpad.net/zope3/+bug/251865
+
 3.5.0 (2008-07-25)
 ==================
 

Modified: zope.component/trunk/setup.py
===================================================================
--- zope.component/trunk/setup.py	2008-07-25 16:09:48 UTC (rev 88819)
+++ zope.component/trunk/setup.py	2008-07-25 16:15:42 UTC (rev 88820)
@@ -26,7 +26,7 @@
 name = 'zope.component'
 setup(
     name=name,
-    version = '3.6.0dev',
+    version = '3.5.1',
     url='http://pypi.python.org/pypi/'+name,
     license='ZPL 2.1',
     description='Zope Component Architecture',

Modified: zope.component/trunk/src/zope/component/zcml.py
===================================================================
--- zope.component/trunk/src/zope/component/zcml.py	2008-07-25 16:09:48 UTC (rev 88819)
+++ zope.component/trunk/src/zope/component/zcml.py	2008-07-25 16:15:42 UTC (rev 88820)
@@ -404,7 +404,10 @@
         raise TypeError("Can't specify factory and component.")
 
     if provides is None:
-        provides = list(zope.interface.providedBy(component))
+        if factory:
+            provides = list(zope.interface.implementedBy(factory))
+        else:
+            provides = list(zope.interface.providedBy(component))
         if len(provides) == 1:
             provides = provides[0]
         else:

Modified: zope.component/trunk/src/zope/component/zcml.txt
===================================================================
--- zope.component/trunk/src/zope/component/zcml.txt	2008-07-25 16:09:48 UTC (rev 88819)
+++ zope.component/trunk/src/zope/component/zcml.txt	2008-07-25 16:15:42 UTC (rev 88820)
@@ -895,6 +895,11 @@
 
   >>> clearZCML()
   >>> runSnippet('''
+  ...   <utility factory="zope.component.testfiles.components.Comp" />''')
+  >>> zope.component.getUtility(IApp).__class__ is Comp
+  True
+
+  >>> runSnippet('''
   ...   <utility factory="zope.component.testfiles.adapter.A4" />''')
   Traceback (most recent call last):
     ...



More information about the Checkins mailing list