[Zope] Can not import PersistentMapping

Sean whysean at softhome.net
Sat Jan 24 11:12:35 EST 2004


Yeah, I am starting to see some differences here from version to version. I
just tried to send my code over to my Linux server which is running Zope
2.6.1, and now It can't fine PersistentList (although the import error is
less catastrophic) - But my dev machine which is running Zope 2.6.2 on
Windows had no problem importing PersistentList (as a module - as previously
stated), but failed badly with PersistentMapping.

Looking at the ZOPE 2.6.2 Source on the Windows machine, I see code for
modules: Persistence.PersistentMapping, and Persistence.PersistentList

On Linux, the Zope 2.6.1 Source has a Persistence Directory with nothing in
it. The __init__.py file says:

     ...While obviously there is nothing in this module,
     the correct names are inserted by the __init__.py
     in ZODB, jumpstarting the process."""

Actually, the __init__.py file on the windows machine says the same thing,
but there ARE in fact source files in the directory for both the
PersistentMapping and PersistentList modules - as well as some ".c" and ".h"
files - as follows:

    cPickleCache.c
    cPersistence.c
    cPersistence.h
    PersistentList.py
    PersistentMapping.py

Would these be differences between the two versions of Zope, or are the
classes not properly setup on the Linux box, and once they are, I could
expect to see the source files that I see on the Windows box?

Or, perhaps the way these classes were being implemented was changing
between the two releases, and I should just upgrade both machines to 2.6.4
which is listed as the current stable release, or 2.7.0rc1.

Recommendations?

--Sean


> -----Original Message-----
> From: Dieter Maurer [mailto:dieter at handshake.de]
> Sent: Saturday, January 24, 2004 5:32 AM
> To: Sean
> Cc: zope at zope.org
> Subject: Re: [Zope] Can not import PersistentMapping
>
>
> Sean wrote at 2004-1-23 22:07 -0500:
> >When I include the following line of code:
> >
> >     from Persistence.PersistentMapping import PersistentMapping
> >
> >in my Product, it causes this error when I try to import it:
> >
> >     AttributeError: 'Persistence.PersistentMapping' module has
> no attribute
> >'__basicnew__'
>
> In my Zope codebase (Zope 2.7b3), "Persistence.PersistentMapping"
> is itself the class (and not a module).
>
> "from Persistence.PersistentMapping import PersistentMapping"
> gives me:
> "ImportError: No module named PersistentMapping".
>
> --
> Dieter




More information about the Zope mailing list