Zope 2.12 and Five - setting of Products.meta_types

View: New views
6 Messages — Rating Filter:   Alert me  

Zope 2.12 and Five - setting of Products.meta_types

by Martin Aspeli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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 )

Re: Zope 2.12 and Five - setting of Products.meta_types

by Martin Aspeli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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 )

Re: Zope 2.12 and Five - setting of Products.meta_types

by Hanno Schlichting-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 6, 2009 at 7:14 AM, Martin Aspeli <optilude+lists@...> 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@...
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 )

Re: persistent product registry optional?

by Chris Withers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hanno Schlichting wrote:

>> 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.

This being Control_Panel/Products? If so, cool :-)
Where is this documented? How do you get the Product Registry to go away?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@...
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 )

Re: persistent product registry optional?

by Hanno Schlichting-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 6, 2009 at 10:02 PM, Chris Withers <chris@...> wrote:
> Hanno Schlichting wrote:
>> Maybe my work
>> in making the persistent product registry optional got rid of the last
>> places this had been used.
>
> This being Control_Panel/Products? If so, cool :-)
> Where is this documented? How do you get the Product Registry to go away?

That would be in the prominent release notes:

http://docs.zope.org/zope2/releases/2.12/WHATSNEW.html#module-cleanup

Just disable the registry and create a Data.fs afterwards or delete
all entries in the Control_Panel/Products for an existing one. I think
HelpSys doesn't work anymore if you disable it, but otherwise all core
Zope functionality works as before.

Hanno
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@...
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 )

Re: persistent product registry optional?

by Tres Seaver :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Withers wrote:

> Hanno Schlichting wrote:
>>> 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.
>
> This being Control_Panel/Products? If so, cool :-)
> Where is this documented? How do you get the Product Registry to go away?

No. This is the 'meta_types' attribute of the 'Products' module.  It
drives the ZMI add list, if nothing else.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver@...
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkr0lZoACgkQ+gerLs4ltQ7PUACbBIT/Hxyu6c3FBKWm3BxNEtFz
fAEAoJsvMVry9AVExctWmEaGqeDba+0A
=aj/k
-----END PGP SIGNATURE-----

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@...
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 )