[Zope-dev] Path expression traversal in z3c.pt

2010-09-24 Thread Albertas Agejevas
Hi,

I tried switching to z3c.pt in one of our projects and found an
incompatibility with zope.app.pagetemplate.  It is not obvious whether
it is a bug or a feature, so I thought I should bring it up here.
Here is a doctest illustrating the incompatibility.

First, let's set up both types of templates:

 from zope.pagetemplate.pagetemplate import PageTemplate
 from zope.app.pagetemplate.engine import TrustedAppPT
 class ZopePageTemplate(TrustedAppPT, PageTemplate):
...  def __init__(self, source):
...   self.pt_edit(source, '')

 from z3c.pt.pagetemplate import PageTemplate as Z3CPageTemplate
 from z3c.pt.expressions import path_translator
 from zope.component import provideUtility
 provideUtility(path_translator, name=path)

Normally, traversing in path expressions prefers attributes over
items, but makes an exception for dict objects.

 arg = {'copy': 1}
 ZopePageTemplate(p tal:content='options/arg/copy'/)(arg=arg)
u'p1/p\n'

 Z3CPageTemplate(p tal:content='options/arg/copy'/)(arg=arg)
u'p1/p'

However, attribute lookup takes precedence for other dict-like objects:

 from UserDict import UserDict
 arg = UserDict()
 arg['copy'] = '1'

 ZopePageTemplate(p tal:content='options/arg/copy'/)(arg=arg)
up{'copy': '1'}/p\n

 Z3CPageTemplate(p tal:content='options/arg/copy'/)(arg=arg)
up{'copy': '1'}/p

However, Zope lets the user override this behaviour by providing a
traversing adapter:

 from zope.traversing.interfaces import ITraversable
 from zope.interface import implements
 class MyDict(UserDict):
... implements(ITraversable)
... def traverse(self, name, path):
...  return self[name]

 arg = MyDict()
 arg['copy'] = '1'
 ZopePageTemplate(p tal:content='options/arg/copy'/)(arg=arg)
u'p1/p\n'

 Z3CPageTemplate(p tal:content='options/arg/copy'/)(arg=arg)
up{'copy': '1'}/p

Here the behaviour diverges, as
zope.app.pagetemplates.engine.ZopeTraverser looks for an ITraversable
adapter and gets DefaultTraversable to implement the default
behaviour, whereas z3c.pt.expressions.ZopeTraverser tries the
attribute lookup before looking up the adapter.

To summarize, z3c.pt prefers attribute lookup to traversable adapters,
whereas zope.app.pagetemplate doesn't.

Is this divergence a bug or a feature?  Anyhow, it should be either
unified or documented.

Albertas
-- 
http://pov.lt -- ZTK/BlueBream consulting and development
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )


[Zope-dev] Zope Tests: 32 OK, 12 Failed, 3 Unknown

2010-09-24 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Sep 23 12:00:00 2010 UTC to Fri Sep 24 12:00:00 2010 UTC.
There were 47 messages: 6 from Zope Tests, 4 from buildbot at pov.lt, 20 from 
buildbot at winbot.zope.org, 11 from ccomb at free.fr, 6 from jdriessen at 
thehealthagency.com.


Test failures
-

Subject: FAILED : winbot / ztk_dev py_265_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:20:56 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020453.html

Subject: FAILED : winbot / ztk_dev py_265_win64
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:31:01 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020454.html

Subject: FAILED : winbot / ztk_10 py_244_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:40:47 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020457.html

Subject: FAILED : Zope Buildbot / zope2.12 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Thu Sep 23 16:52:12 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020460.html

Subject: FAILED : Zope Buildbot / zope2 slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Thu Sep 23 16:52:22 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020461.html

Subject: FAILED : Zope Buildbot / ztk slave-ubuntu64
From: jdriessen at thehealthagency.com
Date: Thu Sep 23 16:52:25 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020462.html

Subject: FAILED : Zope Buildbot / zope2.12 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Thu Sep 23 16:52:35 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020463.html

Subject: FAILED : Zope Buildbot / zope2 slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Thu Sep 23 16:52:44 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020464.html

Subject: FAILED : Zope Buildbot / ztk slave-ubuntu32
From: jdriessen at thehealthagency.com
Date: Thu Sep 23 16:52:47 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020465.html

Subject: FAILED : winbot / zc_buildout_dev py_244_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 17:16:34 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020467.html

Subject: FAILED : winbot / zc_buildout_dev py_265_win64
From: buildbot at winbot.zope.org
Date: Thu Sep 23 17:53:25 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020470.html

Subject: FAILED : winbot / zc_buildout_dev py_270_win64
From: buildbot at winbot.zope.org
Date: Thu Sep 23 18:19:59 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020472.html


Unknown
---

Subject: UNKNOWN : winbot / ztk_dev py_254_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:10:02 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020452.html

Subject: UNKNOWN : winbot / ztk_dev py_270_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:31:02 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020455.html

Subject: UNKNOWN : winbot / ztk_dev py_270_win64
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:31:03 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020456.html


Tests passed OK
---

Subject: OK : winbot / ztk_10 py_254_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:49:10 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020458.html

Subject: OK : winbot / ztk_10 py_265_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 16:57:03 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020459.html

Subject: OK : winbot / ztk_10 py_265_win64
From: buildbot at winbot.zope.org
Date: Thu Sep 23 17:05:15 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020466.html

Subject: OK : winbot / zc_buildout_dev py_254_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 17:28:11 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020468.html

Subject: OK : winbot / zc_buildout_dev py_265_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 17:40:53 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020469.html

Subject: OK : winbot / zc_buildout_dev py_270_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 18:07:01 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020471.html

Subject: OK : winbot / ZODB_dev py_254_win32
From: buildbot at winbot.zope.org
Date: Thu Sep 23 19:15:52 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020473.html

Subject: OK : ZTK 1.0 / Python2.4.6 Linux 64bit
From: ccomb at free.fr
Date: Thu Sep 23 19:41:41 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-September/020474.html

Subject: OK : ZTK 1.0 / Python2.6.5 Linux 64bit
From: ccomb at free.fr
Date: Thu Sep 23 19:42:09 EDT 2010
URL: 

[Zope-dev] Good news: ZODB will work with Python 2.7 (was Re: Heads up: ZODB probably won't work with Python 2.7)

2010-09-24 Thread Jim Fulton
On Fri, Sep 17, 2010 at 6:15 PM, Jim Fulton j...@zope.com wrote:
 I suspect that the shenanigans played by the ZODB persistent cache
 implementation is running afoul of some changes in the garbage
 collection implementation in Python 2.7.

My suspicion was correct. :)

 See https://bugs.launchpad.net/zodb/+bug/641481

Fixed.


 The person reporting this was running a Python compiled in debug mode.
 This will sometimes detect subtle memory management bugs not detected
 with a normal build.  ZODB's tests pass with a normal Python 2.7 build
 and with a debug Python 2.6 build.

 I've tracked one source of crash in a debug build to the cache's
 attempts to manage weak references to ghosts. Even hacking around
 this, there are other crashes that, I assume, are related. :(

 I'll dig further, but I strongly suspect that moving to Python 2.7
 will require a cache reimplementation that uses real Python weak
 references.  This won't happen in ZODB 3.10.

Fortunately, the fix didn't require it.

 If there is anyone on this list who has knowledge of Python GC
 internals, I'd love to get some help. :)

Thanks to Tim Peters for helping me figure out the fix.

Jim

-- 
Jim Fulton
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-dev] Good news: ZODB will work with Python 2.7 (was Re: Heads up: ZODB probably won't work with Python 2.7)

2010-09-24 Thread Christian Theune
On 09/24/2010 05:16 PM, Jim Fulton wrote:
 Thanks to Tim Peters for helping me figure out the fix.

Cheers for Tim! :)


-- 
Christian Theune · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )


[Zope-dev] Summary from the summit

2010-09-24 Thread Christian Theune
Hi there,

thanks again for everyone who joined the summit, I was happy to see so 
many of you come.

The summit definitely had its ups and downs and the discussions 
continued even after when some of you joined us at the DZUG conference 
and even the sprints on the weekend after.

I have compiled a summary from the index cards and notes and put it next 
to the organisational Wiki page:
http://wiki.zope.org/ztk/ZopeSummit2010Summary

Some of the ideas that were presented and some of the discussions that 
were started aren't concluded yet so use the summary as a reminder of 
what topics you'd like to continue talking about and then do so. :)

Also, we have volunteers for individual goals. If you volunteered for 
something, please check back with the goal and help me write down the 
more specific agreements that were promised.

Although we didn't come to a single grandiose conclusion, I'd like to 
point out that I personally (by continued discussion over the week) 
found ideas that I'd like to pursue in the future within the Zope 
community and thus have drawn energy from talking to you - I hope that 
you had at least a little bit of the same.

Hope to see you all again soon,
Christian


PS: I don't want to be secretive about my ideas, but then again, I don't 
know how far I can develop the idea. It's basically about taking the 
ideas of the component architecture, decouple stuff from the web, 
separate the concerns more cleanly etc. In some discussions we dived 
down into more of the patterns and DDD community and I'm hoping to 
explore some of their good ideas (not the architecture astronaut ones) 
but that's a separate story from this post ...

-- 
Christian Theune · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )


[Zope-dev] Developer meeting next Tuesday at 15:00 UTC

2010-09-24 Thread Christian Theune
Good evening,

another developer meeting is coming up next Tuesday at 15:00 UTC.

During the meta-discussion this week Charlie mentioned that we really 
need to keep following up on the issues/goals/topics that were 
identified during the summit.

So, before returning to pure maintenance topics and as the summary [1] 
is online now, I'll open up the next agenda to deal with the outcome of 
the summit.

Hope to see you next week,
Christian

___
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )