Comment 13 for bug 245649

Revision history for this message
Tres Seaver (tseaver) wrote : Re: [Bug 245649] Re: zopectl adduser crash on 2.11.0

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

Philipp von Weitershausen wrote:
> I think we should care about the standard Debian Python, people will
> be trying out Zope with it and if they fail, they'll give it up.
> Whether or not they'll do deployment with a self-compiled Python is
> another question.
>
> Regarding the issue, it seems to me that you already have a
> Products.xxx package on your PYTHONPATH *before* the Zope 2 code is
> executed. You see, 'Products' is a namespace package so it's actually
> forbidden to put any code in there because with namespace packages you
> never know which of the many Products/__init__.py will be loaded first.
>
> Zope, however, violates that rule by having an __ac_permissions__
> variable in its Products/__init__.py and the code that breaks for you
> expects this variable to be there already:
>
> Products.__ac_permissions__=(
> Products.__ac_permissions__+((perm,(),default),))
>
> I think we should get rid of the (rather useless) definition of
> __ac_permissions__ in Products/__init__.py and change all other code
> that uses __ac_permissions__ to accept it not being there (in which
> case it would simply use an empty tuple).
>
> Emmanuel, could you try to subsitute the line above with
>
> ac_permissions = getattr(Products, '__ac_permissions__', ())
> Products.__ac_permissions__=(ac_permissions+((perm,
> (),default),))
>
> and check if it works?

I think we should fix this on the trunk (making Products a proper
namespace package) but not worry about a backport: it is *definitely*
outside the box to run Zope from a Python which already has bits of
another Zope installed (as appears to be the case here).

I will check in the attached as soon as I have finished running the tests.

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

iD8DBQFIb5PW+gerLs4ltQ4RAko9AJ9rLeNUWSEV1vFBWTBYttI053kdUQCbBWKO
SRpl/SPP2jr72eDT+YFj6u0=
=b13f
-----END PGP SIGNATURE-----