Bug#774213: your mail

Kirill Smelkov kirr at nexedi.com
Tue Jan 13 13:16:09 UTC 2015


On Mon, Jan 12, 2015 at 03:40:36PM -0500, Barry Warsaw wrote:
> Something else must still be going on.  I have the following zope packages
> installed:
> 
> % aptitude search zope | grep ^i
> i   python-zope.component           - Zope Component Architecture               
> i   python-zope.configuration       - Zope Configuration Markup Language (ZCML) 
> i   python-zope.deprecation         - Zope Deprecation Infrastructure           
> i   python-zope.event               - Very basic event publishing system        
> i   python-zope.exceptions          - Zope exceptions for Python                
> i   python-zope.i18nmessageid       - Message Identifiers for internationalizati
> i A python-zope.interface           - Interfaces for Python                     
> i   python-zope.location            - Tools for working with object locations   
> i   python-zope.proxy               - Generic transparent proxies for Python    
> i   python-zope.schema              - zope.interface extension for defining data
> i   python-zope.security            - Zope Security Framework                   
> i   python-zope.testing             - Zope testing helpers                      
> i   python-zope.testrunner          - Flexible test runner with layer support fo
> i   python3-zope.component          - Zope Component Architecture               
> i   python3-zope.configuration      - Zope Configuration Markup Language (ZCML) 
> i   python3-zope.deprecation        - Zope Deprecation Infrastructure           
> i   python3-zope.event              - Very basic event publishing system        
> i   python3-zope.exceptions         - Zope exceptions for Python 3              
> i   python3-zope.i18nmessageid      - Message Identifiers for internationalizati
> i   python3-zope.interface          - Interfaces for Python3                    
> i   python3-zope.location           - Tools for working with object locations   
> i   python3-zope.proxy              - Generic transparent proxies for Python    
> i   python3-zope.schema             - zope.interface extension for defining data
> i   python3-zope.testing            - Zope testing helpers for Python 3         
> i   python3-zope.testrunner         - Flexible test runner with layer support fo
> i A zope-common                     - common settings and scripts for Zope insta
> i   zope2.13                        - Open Source Web Application Server
> 
> so definitely python-zope.security, python-zope.proxy, and zope2.13.
                ^^^^^^^^^^^^^^^^^^^^


> and yet...
> 
> % /usr/lib/zope2.13/bin/python 
> 
> >>> import zope.security._proxy
> >>> zope.security._proxy.__file__
> '/usr/lib/python2.7/dist-packages/zope/security/_proxy.x86_64-linux-gnu.so'

I think I'm starting to understand: I do _not_ have python-zope.security
installed (because nothing depends on it including zope2.13).

    clean at teco:~$ dpkg -l |grep zope
    ii  python-zope.interface                 4.1.1-3.1
    ii  python-zope.proxy                     4.1.4-2
    ii  zope-common                           0.5.54
    ii  zope2.13                              2.13.22-1

If I install python-zope.security, then import goes ok:

    clean at teco:~$ dpkg -l |grep zope
    ii  python-zope.component                 4.2.1-2
    ii  python-zope.event                     4.0.3-2
    ii  python-zope.i18nmessageid             4.0.3-1
    ii  python-zope.interface                 4.1.1-3.1
    ii  python-zope.location                  4.0.3-1
    ii  python-zope.proxy                     4.1.4-2
    ii  python-zope.schema                    4.4.2-1
    ii  python-zope.security                  4.0.1-1
    ii  zope-common                           0.5.54
    ii  zope2.13                              2.13.22-1

    clean at teco:~$ /usr/lib/zope2.13/bin/python 

    >>> import zope.security._proxy
    >>> zope.security._proxy.__file__
    '/usr/lib/python2.7/dist-packages/zope/security/_proxy.x86_64-linux-gnu.so'

but the imported module is NOT from zope2.13 package, as it should be:

    clean at teco:~$ dpkg -L zope2.13 |grep security |grep proxy.so
    /usr/lib/zope2.13/lib/python/zope.security-3.7.4.egg/zope/security/_proxy.so


after purging python-zope.security import fails, but in a new way:

    clean at teco:~$ dpkg -l |grep zope
    ii  python-zope.interface                 4.1.1-3.1
    ii  python-zope.proxy                     4.1.4-2
    ii  zope-common                           0.5.54
    ii  zope2.13                              2.13.22-1

    clean at teco:~$ /usr/lib/zope2.13/bin/python 
    
    >>> import zope.security._proxy
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
    ImportError: No module named security._proxy

and if I remove and then install zope2.13 (with python-zope.security
still being removed) it is still the same:

    clean at teco:~$ dpkg -l |grep zope
    ii  python-zope.interface                 4.1.1-3.1
    ii  python-zope.proxy                     4.1.4-2
    ii  zope-common                           0.5.54
    ii  zope2.13                              2.13.22-1

    clean at teco:~$ /usr/lib/zope2.13/bin/python 
    
    >>> import zope.security._proxy
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
    ImportError: No module named security._proxy

and if then I remove python-zope.proxy:

    clean at teco:~$ dpkg -l |grep zope
    ii  zope-common                           0.5.54
    ii  zope2.13                              2.13.22-1

    clean at teco:~$ /usr/lib/zope2.13/bin/python 

    >>> import zope.security._proxy
    >>> zope.security._proxy.__file__
    '/usr/lib/zope2.13/lib/python/zope.security-3.7.4.egg/zope/security/_proxy.so'
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    NOTE - different from /usr/lib/python2.7/dist-packages/zope/security/_proxy.x86_64-linux-gnu.so'

and if I install python-zope.proxy again:

    clean at teco:~$ dpkg -l |grep zope
    ii  python-zope.interface                 4.1.1-3.1
    ii  python-zope.proxy                     4.1.4-2
    ii  zope-common                           0.5.54
    ii  zope2.13                              2.13.22-1

    clean at teco:~$ /usr/lib/zope2.13/bin/python 
    
    >>> import zope.security._proxy
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "/usr/lib/zope2.13/lib/python/zope.security-3.7.4.egg/zope/security/__init__.py", line 19, in <module>
        from zope.security.management import checkPermission
      File "/usr/lib/zope2.13/lib/python/zope.security-3.7.4.egg/zope/security/management.py", line 23, in <module>
        from zope.security.checker import CheckerPublic
      File "/usr/lib/zope2.13/lib/python/zope.security-3.7.4.egg/zope/security/checker.py", line 46, in <module>
        from zope.security._proxy import _Proxy as Proxy, getChecker
    SystemError: dynamic module not initialized properly


oops.

Conclusion: not enough isolation leads to either flaky behaviour (i.e.
zope.security imports, but version is  4.0.1-1 instead of expected by
zope2.13 3.7.4) or import failing at all.

And there is some hidden state which depends on packages installation
order etc...

So sad,
Kirill



More information about the pkg-zope-developers mailing list