[PEAK] Does a PEAK-ized webware esist ?

Phillip J. Eby pje at telecommunity.com
Fri Jan 30 19:05:53 EST 2004

At 05:24 PM 1/30/04 -0600, wayne at larsen.st wrote:

>Thank you very much for that lengthy explanation.  That gives me a
>framework for understanding, or at least beginning to understand what's
>going on.  Your email didn't serve its purpose of scaring me off, so
>instead I'll try to see if I can get something running.  As a result I may
>be asking some stupid questions.
>In the meantime though, I tried again to get the trivial_web example
>going.  cgi runs, but when I run the trivial web example, I get the
>following traceback.  This is the same with both ZopeX3 M3, and ZopeX3

Interesting; I've not seen that before.  Let me ask you this: did you 
install Zope *before*, or *after* PEAK?  Are they on different parts of the 

It looks like Zope is complaining about the 'zope.interface' module having 
its interface declared twice, which is rather weird since PEAK doesn't 
declare anything for 'zope.interface' IIRC.  It may be that something in 
PEAK's lazy import mechanism is conflicting with later versions of Zope 
X3's interface API.  I've tested PyProtocols with Zope X3 MS4 (I think 
that's the version #), but the last time I actually used 'peak.web' for 
anything (apart from running its non-Zope dependent tests) was around 
milestone 2.

I've been meaning to try it with MS4, so I'll see if I can take it for a 
spin this weekend.  It's probably something simple.  Interesting bit that I 
see: the jump from "from persistence._persistence import Persistent" to 
"from zope.interface import Interface".  If I'm reading that right, it's 
actually the C-level '_persistence' code that's importing 
'persistence.interfaces' and triggering that jump.  This *may* have 
something to do with it, but I don't know for sure.

Still, it's pretty obvious from your traceback that simply *having* Zope on 
the path is sufficient to trigger this, so I should probably just build the 
latest milestone and give it a whirl.

>Traceback (most recent call last):
>   File "/usr/bin/peak", line 3, in ?
>     from peak.running import commands
>   File "/usr/lib/python2.3/site-packages/peak/running/commands.py", line
>124, in ?
>     class AbstractCommand(binding.Component):
>   File "/usr/lib/python2.3/site-packages/peak/running/commands.py", line
>133, in AbstractCommand
>     argv    = binding.Obtain('import:sys:argv')
>   File "/usr/lib/python2.3/site-packages/peak/binding/components.py", line
>520, in __init__
>     self.targetName = adapt(targetName, IComponentKey)
>   File "C:\cygwin\home\pje\PyProtocols\src/protocols/_speedups.pyx", line
>175, in _speedups.adapt
>   File "C:\cygwin\home\pje\PyProtocols\src/protocols/_speedups.pyx", line
>170, in _speedups.adapt
>   File "C:\cygwin\home\pje\PyProtocols\src/protocols/_speedups.pyx", line
>378, in _speedups.Protocol__adapt__
>   File "/usr/lib/python2.3/site-packages/peak/binding/components.py", line
>374, in <lambda>
>     lambda ob, proto: toName(ob, ComponentName, 1),
>   File "/usr/lib/python2.3/site-packages/peak/naming/names.py", line 306,
>in toName
>     import URL
>   File "/usr/lib/python2.3/site-packages/peak/naming/URL.py", line 9, in ?
>     from peak.model.elements import Struct
>   File "/usr/lib/python2.3/site-packages/peak/model/elements.py", line 17,
>in ?
>     from peak.persistence import Persistent
>   File "/usr/lib/python2.3/site-packages/peak/persistence.py", line 13, in ?
>     Persistent             = importString('persistence:Persistent', md)
>   File "/usr/lib/python2.3/site-packages/peak/util/imports.py", line 79,
>in importString
>     item = __import__('.'.join(path), globalDict, globalDict, ['__name__'])
>   File "/d/src/python/z/ZopeX3-0.0m3/src/persistence/__init__.py", line
>16, in ?
>     from persistence._persistence import Persistent
>   File "/d/src/python/z/ZopeX3-0.0m3/src/persistence/interfaces.py", line
>14, in ?
>     from zope.interface import Interface
>   File "/d/src/python/z/ZopeX3-0.0m3/src/zope/interface/__init__.py", line
>93, in ?
>     moduleProvides(IInterfaceDeclaration)
>   File "/d/src/python/z/ZopeX3-0.0m3/src/zope/interface/declarations.py",
>line 1258, in moduleProvides
>     raise TypeError(
>TypeError: moduleProvides can only be used once in a module definition.
>PEAK mailing list
>PEAK at eby-sarna.com

More information about the PEAK mailing list