Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Zope 2.12 and Five - setting of Products.meta_types

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


optilude+lists at gmail

Nov 5, 2009, 10:14 PM

Post #1 of 3 (776 views)
Permalink
Zope 2.12 and Five - setting of Products.meta_types

Hi,

Something has changed in Zope 2.12 that is causing tests that use
PlacelessSetup's tearDown() with Five to fail:

Error in test
/Users/optilude/Development/Plone/Code/Build/plone/4.0/src/plone.autoform/plone/autoform/tests/../autoform.txt
Traceback (most recent call last):
File
"/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/doctest.py",
line 2416, in debug
self.tearDown()
File
"/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/doctest.py",
line 2295, in tearDown
self._dt_tearDown(test)
File
"/Users/optilude/.buildout/eggs/zope.app.testing-3.6.2-py2.6.egg/zope/app/testing/placelesssetup.py",
line 59, in tearDown
tearDown_()
File
"/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/cleanup.py",
line 55, in cleanUp
cleanUp()
File
"/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/cleanup.py",
line 63, in cleanUp
func(*args, **kw)
File
"/Users/optilude/.buildout/eggs/Zope2-2.12.1-py2.6-macosx-10.6-i386.egg/Products/Five/fiveconfigure.py",
line 228, in cleanUp
Products.meta_types = tuple([ info for info in Products.meta_types
AttributeError: 'module' object has no attribute 'meta_types'


Sure enough, Products.meta_types is not set. In the Zope2 egg,
Products/__init__.py contains only the setuptools boilerplate for
namespace packages. I'm not sure how or where Products.meta_type is set
these days.

Does anyone know how to correctly fix this? We could make the tear-down
code in Five more robust, obviously, but I fear that's just hiding a
deeper problem?

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


optilude+lists at gmail

Nov 6, 2009, 12:21 AM

Post #2 of 3 (711 views)
Permalink
Re: Zope 2.12 and Five - setting of Products.meta_types [In reply to]

Martin Aspeli wrote:
> Hi,
>
> Something has changed in Zope 2.12 that is causing tests that use
> PlacelessSetup's tearDown() with Five to fail:
>
> Error in test
> /Users/optilude/Development/Plone/Code/Build/plone/4.0/src/plone.autoform/plone/autoform/tests/../autoform.txt
> Traceback (most recent call last):
> File
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/doctest.py",
> line 2416, in debug
> self.tearDown()
> File
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/doctest.py",
> line 2295, in tearDown
> self._dt_tearDown(test)
> File
> "/Users/optilude/.buildout/eggs/zope.app.testing-3.6.2-py2.6.egg/zope/app/testing/placelesssetup.py",
> line 59, in tearDown
> tearDown_()
> File
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/cleanup.py",
> line 55, in cleanUp
> cleanUp()
> File
> "/Users/optilude/.buildout/eggs/zope.testing-3.7.7-py2.6.egg/zope/testing/cleanup.py",
> line 63, in cleanUp
> func(*args, **kw)
> File
> "/Users/optilude/.buildout/eggs/Zope2-2.12.1-py2.6-macosx-10.6-i386.egg/Products/Five/fiveconfigure.py",
> line 228, in cleanUp
> Products.meta_types = tuple([ info for info in Products.meta_types
> AttributeError: 'module' object has no attribute 'meta_types'
>
>
> Sure enough, Products.meta_types is not set. In the Zope2 egg,
> Products/__init__.py contains only the setuptools boilerplate for
> namespace packages. I'm not sure how or where Products.meta_type is set
> these days.
>
> Does anyone know how to correctly fix this? We could make the tear-down
> code in Five more robust, obviously, but I fear that's just hiding a
> deeper problem?

I couldn't find a deeper problem, so I just added some safety to the
cleanUp() method using getattr(). If anyone thinks this is a bad idea,
let me know.

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


hanno at hannosch

Nov 6, 2009, 5:01 AM

Post #3 of 3 (701 views)
Permalink
Re: Zope 2.12 and Five - setting of Products.meta_types [In reply to]

On Fri, Nov 6, 2009 at 7:14 AM, Martin Aspeli <optilude+lists [at] gmail> wrote:
> Something has changed in Zope 2.12 that is causing tests that use
> PlacelessSetup's tearDown() with Five to fail:
>
> "/Users/optilude/.buildout/eggs/Zope2-2.12.1-py2.6-macosx-10.6-i386.egg/Products/Five/fiveconfigure.py",
> line 228, in cleanUp
>     Products.meta_types = tuple([ info for info in Products.meta_types
> AttributeError: 'module' object has no attribute 'meta_types'
>
> Sure enough, Products.meta_types is not set. In the Zope2 egg,
> Products/__init__.py contains only the setuptools boilerplate for
> namespace packages. I'm not sure how or where Products.meta_type is set
> these days.

This is all part of App.ProductContext and friends. It's also set in
fiveconfigure during _registerClass or in ZopeTestCase's
installProduct.

> Does anyone know how to correctly fix this? We could make the tear-down
> code in Five more robust, obviously, but I fear that's just hiding a
> deeper problem?

I don't know who actually needs and reads this type of information.
It's one part of the Zope2 universe I think at least Plone doesn't use
anymore at all. Simply grepping for meta_types doesn't show any place
that uses the information for anything useful anymore. Maybe my work
in making the persistent product registry optional got rid of the last
places this had been used.

Hanno
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.