[Zope-Checkins] SVN: Zope/trunk/lib/python/ Merged 40370 from 2.9 branch:
Log message for revision 40371: Merged 40370 from 2.9 branch: Send ContainerModifiedEvent when appropriate. This requires Five 1.3+ = r20254. Some BBB has been kept until Zope 3.2 = r40368 is stiched in. Changed: U Zope/trunk/lib/python/OFS/CopySupport.py U Zope/trunk/lib/python/OFS/ObjectManager.py U Zope/trunk/lib/python/OFS/OrderSupport.py U Zope/trunk/lib/python/Products/BTreeFolder2/BTreeFolder2.py -=- Modified: Zope/trunk/lib/python/OFS/CopySupport.py === --- Zope/trunk/lib/python/OFS/CopySupport.py2005-11-25 18:47:48 UTC (rev 40370) +++ Zope/trunk/lib/python/OFS/CopySupport.py2005-11-25 18:50:38 UTC (rev 40371) @@ -37,6 +37,8 @@ from zope.event import notify from zope.app.event.objectevent import ObjectCopiedEvent from zope.app.container.contained import ObjectMovedEvent +import Products.Five # BBB: until Zope 3.2 = r40368 is stiched in +from zope.app.container.contained import notifyContainerModified from OFS.event import ObjectWillBeMovedEvent from OFS.event import ObjectClonedEvent import OFS.subscribers @@ -273,6 +275,9 @@ ob = self._getOb(id) notify(ObjectMovedEvent(ob, orig_container, orig_id, self, id)) +notifyContainerModified(orig_container) +if aq_base(orig_container) is not aq_base(self): +notifyContainerModified(self) ob._postCopy(self, op=1) # try to make ownership implicit if possible @@ -346,6 +351,7 @@ ob = self._getOb(new_id) notify(ObjectMovedEvent(ob, self, id, self, new_id)) +notifyContainerModified(self) ob._postCopy(self, op=1) Modified: Zope/trunk/lib/python/OFS/ObjectManager.py === --- Zope/trunk/lib/python/OFS/ObjectManager.py 2005-11-25 18:47:48 UTC (rev 40370) +++ Zope/trunk/lib/python/OFS/ObjectManager.py 2005-11-25 18:50:38 UTC (rev 40371) @@ -53,6 +53,8 @@ from zope.event import notify from zope.app.container.contained import ObjectAddedEvent from zope.app.container.contained import ObjectRemovedEvent +import Products.Five # BBB: until Zope 3.2 = r40368 is stiched in +from zope.app.container.contained import notifyContainerModified from OFS.event import ObjectWillBeAddedEvent from OFS.event import ObjectWillBeRemovedEvent import OFS.subscribers @@ -312,6 +314,7 @@ if not suppress_events: notify(ObjectAddedEvent(ob, self, id)) +notifyContainerModified(self) OFS.subscribers.compatibilityCall('manage_afterAdd', ob, ob, self) @@ -360,6 +363,7 @@ if not suppress_events: notify(ObjectRemovedEvent(ob, self, id)) +notifyContainerModified(self) security.declareProtected(access_contents_information, 'objectIds') def objectIds(self, spec=None): Modified: Zope/trunk/lib/python/OFS/OrderSupport.py === --- Zope/trunk/lib/python/OFS/OrderSupport.py 2005-11-25 18:47:48 UTC (rev 40370) +++ Zope/trunk/lib/python/OFS/OrderSupport.py 2005-11-25 18:50:38 UTC (rev 40371) @@ -24,6 +24,8 @@ from DocumentTemplate.sequence import sort from Globals import InitializeClass from zope.interface import implements +import Products.Five # BBB: until Zope 3.2 = r40368 is stiched in +from zope.app.container.contained import notifyContainerModified from interfaces import IOrderedContainer as z3IOrderedContainer from IOrderSupport import IOrderedContainer as z2IOrderedContainer @@ -135,7 +137,8 @@ # security.declareProtected(manage_properties, 'moveObjectsByDelta') -def moveObjectsByDelta(self, ids, delta, subset_ids=None): +def moveObjectsByDelta(self, ids, delta, subset_ids=None, + suppress_events=False): Move specified sub-objects by delta. if type(ids) is StringType: @@ -180,6 +183,9 @@ 'not exist.' % subset_ids[pos]) self._objects = tuple(objects) +if not suppress_events: +notifyContainerModified(self) + return counter security.declareProtected(manage_properties, 'moveObjectsUp') @@ -227,11 +233,12 @@ raise ValueError('The object with the id %s does not exist.' % id) security.declareProtected(manage_properties, 'moveObjectToPosition') -def moveObjectToPosition(self, id, position): +def moveObjectToPosition(self, id, position, suppress_events=False): Move specified object to absolute position. delta = position - self.getObjectPosition(id) -return self.moveObjectsByDelta(id, delta) +return self.moveObjectsByDelta(id, delta, + suppress_events=suppress_events)
[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/Five/ Updated to Five 1.3b4.
Log message for revision 40372: Updated to Five 1.3b4. Changed: U Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt U Zope/branches/2.9/lib/python/Products/Five/__init__.py U Zope/branches/2.9/lib/python/Products/Five/tests/event.txt U Zope/branches/2.9/lib/python/Products/Five/tests/test_security.py U Zope/branches/2.9/lib/python/Products/Five/version.txt -=- Modified: Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt === --- Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt 2005-11-25 18:50:38 UTC (rev 40371) +++ Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt 2005-11-25 21:21:52 UTC (rev 40372) @@ -2,6 +2,16 @@ Five Changes +Five 1.3b4 (2005-11-25) +=== + +Restructuring +- + +* Cleaned up security test. + +* Made Five send a ContainerModifiedEvent when appropriate. + Five 1.3b3 (2005-11-19) === Modified: Zope/branches/2.9/lib/python/Products/Five/__init__.py === --- Zope/branches/2.9/lib/python/Products/Five/__init__.py 2005-11-25 18:50:38 UTC (rev 40371) +++ Zope/branches/2.9/lib/python/Products/Five/__init__.py 2005-11-25 21:21:52 UTC (rev 40372) @@ -13,13 +13,17 @@ ## Initialize the Five product -$Id: __init__.py 12884 2005-05-30 13:10:41Z philikon $ +$Id: __init__.py 20254 2005-11-25 18:45:08Z efge $ import Acquisition from Globals import INSTANCE_HOME +import monkey # BBB: goes away when Zope 3.2 = r40368 is stiched in import zcml +# trigger monkey patches +monkey.monkeyPatch() + # public API provided by Five # usage: from Products.Five import something from browser import BrowserView Modified: Zope/branches/2.9/lib/python/Products/Five/tests/event.txt === --- Zope/branches/2.9/lib/python/Products/Five/tests/event.txt 2005-11-25 18:50:38 UTC (rev 40371) +++ Zope/branches/2.9/lib/python/Products/Five/tests/event.txt 2005-11-25 21:21:52 UTC (rev 40372) @@ -105,6 +105,7 @@ ObjectWillBeAddedEvent sub ObjectAddedEvent sub old manage_afterAdd sub sub folder + ContainerModifiedEvent folder 'sub' sub = folder.sub ob = MyContent('dog') @@ -112,6 +113,7 @@ ObjectWillBeAddedEvent dog ObjectAddedEvent dog old manage_afterAdd dog dog sub + ContainerModifiedEvent sub 'dog' And when we rename the subfolder, manage_beforeDelete is also called @@ -126,6 +128,7 @@ old manage_afterAdd marine marine folder ObjectMovedEvent dog old manage_afterAdd dog marine folder + ContainerModifiedEvent folder Same thing for clone:: @@ -137,6 +140,7 @@ old manage_afterAdd tank tank folder ObjectAddedEvent dog old manage_afterAdd dog tank folder + ContainerModifiedEvent folder ObjectClonedEvent tank old manage_afterClone tank tank ObjectClonedEvent dog @@ -161,6 +165,7 @@ ObjectWillBeAddedEvent lassie ObjectAddedEvent lassie old manage_afterAdd lassie lassie folder + ContainerModifiedEvent folder 'lassie' And when we delete the object, manage_beforeDelete is also called and @@ -170,6 +175,7 @@ ObjectWillBeRemovedEvent lassie old manage_beforeDelete lassie lassie folder ObjectRemovedEvent lassie + ContainerModifiedEvent folder The old behavior happens for a move or a copy, with events too. For a move:: @@ -179,6 +185,7 @@ ObjectWillBeAddedEvent blueberry ObjectAddedEvent blueberry old manage_afterAdd blueberry blueberry folder + ContainerModifiedEvent folder 'blueberry' cp = folder.manage_cutObjects('blueberry') folder.manage_pasteObjects(cp) @@ -186,6 +193,7 @@ old manage_beforeDelete blueberry blueberry folder ObjectMovedEvent blueberry old manage_afterAdd blueberry blueberry folder + ContainerModifiedEvent folder [{'new_id': 'blueberry', 'id': 'blueberry'}] Old behavior with events for a copy:: @@ -196,6 +204,7 @@ ObjectWillBeAddedEvent copy_of_blueberry ObjectAddedEvent copy_of_blueberry old manage_afterAdd copy_of_blueberry copy_of_blueberry folder + ContainerModifiedEvent folder ObjectClonedEvent copy_of_blueberry old manage_afterClone copy_of_blueberry copy_of_blueberry [{'new_id': 'copy_of_blueberry', 'id': 'blueberry'}] @@ -207,6 +216,7 @@ old manage_beforeDelete copy_of_blueberry copy_of_blueberry folder ObjectMovedEvent myrtille old manage_afterAdd myrtille myrtille folder + ContainerModifiedEvent folder Old behavior with events for a clone:: @@ -215,6 +225,7 @@ ObjectWillBeAddedEvent strawberry ObjectAddedEvent strawberry old manage_afterAdd strawberry strawberry folder + ContainerModifiedEvent folder ObjectClonedEvent strawberry old manage_afterClone strawberry strawberry res.getId() @@ -227,12 +238,14
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/monkey.py Forgotten in Five 1.3b4 merge.
Log message for revision 40375: Forgotten in Five 1.3b4 merge. Changed: A Zope/trunk/lib/python/Products/Five/monkey.py -=- Added: Zope/trunk/lib/python/Products/Five/monkey.py === --- Zope/trunk/lib/python/Products/Five/monkey.py 2005-11-25 21:30:04 UTC (rev 40374) +++ Zope/trunk/lib/python/Products/Five/monkey.py 2005-11-25 21:30:39 UTC (rev 40375) @@ -0,0 +1,71 @@ +## +# +# Copyright (c) 2005 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +## +Bad monkey! + +BBB: goes away when Zope 3.2 = r40368 is stiched in + +$Id$ + +def monkeyPatch(): +Trigger all monkey patches needed to make Five work. + +Monkey patches are kept to a minimum level. + +zope3_monkey() + +def zope3_monkey(): +Fix Zope 3 to have the proper ContainerModifiedEvent that has +been added for 3.2. + +try: +from zope.app.container.contained import notifyContainerModified +except ImportError: +pass +else: +return + +# BBB: goes away when Zope 3.2 = r40368 is stiched in + +from zope.event import notify +from zope.interface import implements +import zope.app.container.contained +import zope.app.container.interfaces +from zope.app.event.objectevent import ObjectModifiedEvent +from zope.app.event.interfaces import IObjectModifiedEvent + +class IContainerModifiedEvent(IObjectModifiedEvent): +The container has been modified. + +This event is specific to containerness modifications, which +means addition, removal or reordering of sub-objects. + + +zope.app.container.interfaces.IContainerModifiedEvent = \ +IContainerModifiedEvent + + +class ContainerModifiedEvent(ObjectModifiedEvent): +The container has been modified. +implements(IContainerModifiedEvent) + +zope.app.container.contained.ContainerModifiedEvent = \ +ContainerModifiedEvent + + +def notifyContainerModified(object, *descriptions): +Notify that the container was modified. +notify(ContainerModifiedEvent(object, *descriptions)) + +zope.app.container.contained.notifyContainerModified = \ +notifyContainerModified Property changes on: Zope/trunk/lib/python/Products/Five/monkey.py ___ Name: svn:keywords + Id Name: svn:eol-style + native ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] I volunteer to make ConflictError handling better if you guys can help me ;-)
Dieter Maurer wrote: What is this telling me? It is incredibly stupid. So I'm gathering... The message above only tells you, that (at the given time) a request for /some_uri resulted in a ConflictError and that since startup (at the given time) 347 conflicts occured. Unfortunately, it does not tell you * what object caused the conflict * whether it is a read or a write conflict (read conflicts are very rare since MVCC introduction, but they may still happen) * for write conflicts: what versions of the object did particate ...and most importantly, whether or not this conflict error was resolved! (ie: did the user see this as an error, or just poor performance?) A long time ago, I posted an extension making this additional information available (it is all present in the exception instance. Zope is just too stupid to read (and log) it). I would really appreciate it if you could dig this out and give me a direct url. If you do, I promise I will see it gets properly merged into the Zope core... Did the user actually see a ConflictError page? Usually not. ...which, as I suspect you agree with me, simple isn't a good enough answer ;-) I analysed the logs from our cluster and we're getting about 450 conflict errors in our busiest hours when the cluster of 8 ZEO clients is taking about 11,000 hits in that hour. Is this 'bad'? I would not be happy: it is about 5 %. Yeah, me neither, but it would be great to quantify all of this :-) If so, where should I start to make things better? You find out which objects cause the conflicts. You analyse what you can do to reduce concurrent writes to these objects (split into separate persistent subobjects) or whether you can provide conflict resolution. ...and I think the best way to get cracking with this is to improve logging and tidy up the retrying code for ConflictError. I've volunteered to do that, and will get to it asap, but I'm gonna need as much help as possible, particularly in reviewing code. OK, I'm guessing I'll cut a branch when I start, I really want this to land ASAP. Where should I start from? Will there be more 2.8 releases or should I go for 2.9 and then merge to the trunk? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Not-really-unit-testing ideas.
Fred Drake wrote: On 11/23/05, Lennart Regebro [EMAIL PROTECTED] wrote: Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I Jim's new test runner includes support for layers, which solves this issue. I think the Zope 2 trunk is already using the new test runner; you can also use it on the Zope 3 trunk. We're using test layers extensively here, and it really helps. Cool, how does a Zope 2.8.4 developer go about findout out about these layers and using them? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: How bad _are_ ConflictErrors
Florent Guillaume wrote: I'm actually not sure what's logged when a Conflict Error makes it back to the users, offhand I don't see anything in my logs. Can someone confirm or infirm that fact? Well, I can agree based on empirical evidence. I have MailingLogger (sorry, I really feel the need to plug this product more!) on all the clusters where I have ConflictError problems, and it's never once mailed me a log entry containing one :-( If nothing is logged, I'll add something at level ERROR. Has this been done? If not, I volunteer to do it as part of my upcoming make COnflictErrors suck less work ;-) BTW does someone have a handy script to provoke conflict errors on a naked Zope? from ZODB.POSException import ConflictError raise ConflictError ;-) Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ConflictError shouldn't subclass Exception
Hi All, Chris McDonough wrote: Is this the number of log messages that indicate a conflict error occurred (e.g. x conflict errors since DATE messages in the event log) or the number of conflict errors that are retried more than three times and thus make it out to the app user? I'm guessing the former. I'm interested to see that this causes everyone the same level of confusion ;-) I'll reply to the other message about this though... The real reason they're called errors is only because they're implemented as Python exceptions. They are implemented as exceptions because it was the easiest mechanism to use (exceptions are already built into Python). Interestingly, you can raise things that don't subclass Exception in python. This was discussed before, and I firmly agree with, that zodb conflicts should _not_ sublcass exception. That way, there's less chance of them being caught by inexperienced programmers putting in try: except Exception: 's. How would we go about making this change? The Zope conflict exception catching code is written in such a complicated way (and without the benefit of any automated tests) that tracking that down could take an entire day which I don't have to burn ATM. So I'm afraid the status quo will prevail until someone gets so indignant about it that they either pay for it to be fixed or fix it themselves. Apologies for that. :-( Okay, I'll bite, I might well be able to stump up the paid time on this if you guys can help me justify it as a performance improvement :-) I hope I can count on a bit of moral and intellectual support if I manage to make this happen! cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: How bad _are_ ConflictErrors
Chris Withers wrote: If nothing is logged, I'll add something at level ERROR. Has this been done? If not, I volunteer to do it as part of my upcoming make COnflictErrors suck less work ;-) I'm working on it at the moment. BTW does someone have a handy script to provoke conflict errors on a naked Zope? from ZODB.POSException import ConflictError raise ConflictError Guess what, I know that. But I want a real ConflictError, to see what useful info about involved objects I can log. Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: How bad _are_ ConflictErrors
On Fri, Nov 25, 2005 at 11:22:32AM +0100, Florent Guillaume wrote: | Guess what, I know that. But I want a real ConflictError, to see what | useful info about involved objects I can log. I'm pretty sure there are ZODB tests that exercise the creation and handling of ConflictError. -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Not-really-unit-testing ideas.
Chris Withers wrote: Fred Drake wrote: On 11/23/05, Lennart Regebro [EMAIL PROTECTED] wrote: Basically, I'd like to create a site once, and use it for all subsequent tests, until I made a change that means the site needs to be recreated. But how? Well, I'm not sure. How, for example, could I Jim's new test runner includes support for layers, which solves this issue. I think the Zope 2 trunk is already using the new test runner; you can also use it on the Zope 3 trunk. We're using test layers extensively here, and it really helps. Cool, how does a Zope 2.8.4 developer go about findout out about these layers and using them? Look at http://svn.zope.org/zope.testing/trunk/src/zope/testing/. Unfortunately, there isn't really documentation on what layers are for or how to write them. This is a an ommission that needs to be addressed. You should be able to use the new test runner in 2.8. We use it with 3.1. It is included in 2.9 and 3.2. To see how layers are are used, look at zope.app.testing.functional on the Z3 trunk. The Zope 3 functional tests are now provided via a layer. In the coming months we'll be releasing packages that use layers to provide independent functional tests. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] removing test.py from path
Hello, Benji recently changed test.py in Z3 in order to avoid collision name with the standard python 'test' module. I bumped into the same problem running tests under Z 2.8. I would like to add this change as well in Z 2.8 bin/test.py if no one objects. Tarek -- Tarek Ziadé | Nuxeo RD (Paris, France) CPS Plateform : http://www.cps-project.org mail: tziade at nuxeo.com | tel: +33 (0) 6 30 37 02 63 You need Zope 3 - http://www.z3lab.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] removing test.py from path
Tarek Ziadé wrote: Hello, Benji recently changed test.py in Z3 in order to avoid collision name with the standard python 'test' module. I bumped into the same problem running tests under Z 2.8. I would like to add this change as well in Z 2.8 bin/test.py if no one objects. oups, tipo, (Z2 trunk, i mean) ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] More events
I've made changes so that Five and (Zope 2.9 Zope 2 trunk) send IContainerModifiedEvents when appropriate. These events are new in Zope 3.2, and subclass IObjectModifiedEvents. This is of course available in Five 1.2 and Five 1.3. I still have to stich in a snapshot of Five 1.3 into Zope 2.9 and Zope 2 trunk to make them work. I'll do that later today. Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] buildbot failure in Zope trunk 2.4 Linux zc-buildbot
The Buildbot has detected a failed build of Zope trunk 2.4 Linux zc-buildbot. Buildbot URL: http://buildbot.zope.org/ Build Reason: changes Build Source Stamp: 1818 Blamelist: anguenot,chrisw,efge,jinty,sidnei,yuppie BUILD FAILED: failed test sincerely, -The Buildbot ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ConflictError shouldn't subclass Exception
2005/11/24, Chris Withers [EMAIL PROTECTED]: Interestingly, you can raise things that don't subclass Exception in python. This was discussed before, and I firmly agree with, that zodb conflicts should _not_ sublcass exception. That way, there's less chance of them being caught by inexperienced programmers putting in try: except Exception: 's. How would we go about making this change? class my_own_exception: pass try: raise my_own_exception() except: print Doesn't help against inexperienced programmers. sadly You can even raise a string, which is accidently done in zope2 and where my with provided solution and unit test is pending. It is better to beat people using except: without good reasons. Patrick ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ConflictError shouldn't subclass Exception
On Nov 25, 2005, at 2:25 PM, Patrick Gerken wrote: 2005/11/24, Chris Withers [EMAIL PROTECTED]: Interestingly, you can raise things that don't subclass Exception in python. This was discussed before, and I firmly agree with, that zodb conflicts should _not_ sublcass exception. That way, there's less chance of them being caught by inexperienced programmers putting in try: except Exception: 's. How would we go about making this change? class my_own_exception: pass try: raise my_own_exception() except: print Doesn't help against inexperienced programmers. sadly You can even raise a string, which is accidently done in zope2 and where my with provided solution and unit test is pending. It is better to beat people using except: without good reasons. Yup. Lots of talk has been going on on python-dev about putting exceptions into multiple hierarchies lately, which would solve the problem at the right level. - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] I volunteer to make ConflictError handling better if you guys can help me ;-)
Chris Withers wrote at 2005-11-24 19:42 +: ... I would really appreciate it if you could dig this out and give me a direct url. If you do, I promise I will see it gets properly merged into the Zope core... You know that I *never* search for others (I hate searching). But I can show you the code, we currently use in our Zope version (which has the improved logging and some other fixes): if issubclass(t, ConflictError): # First, we need to close the current connection. We'll # do this by releasing the hold on it. There should be # some sane protocol for this, but for now we'll use # brute force: global conflict_errors conflict_errors = conflict_errors + 1 method_name = REQUEST.get('PATH_INFO', '') err = ('ZODB conflict error at %s: %s' '(%s conflicts since startup at %s)') LOG(err % (method_name, str(v), conflict_errors, startup_time), INFO, '') LOG('Conflict traceback', BLATHER, '', error=sys.exc_info()) raise ZPublisher.Retry(t, v, traceback) # DM 2005-06-28: work around lost retry exception logs problem # (reported by Malcolm Cleaton mailto:[EMAIL PROTECTED] # in the mailing list) #if t is ZPublisher.Retry: v.reraise() if t is ZPublisher.Retry: try: v.reraise() except: t, v, traceback = sys.exc_info() This code sits in Zope2.App.startup.zpublisher_exception_hook. The improved logging is achieved by including str(v) (v contains the exception value) into the log message (it is that easy). The last part (marked with DM 2005-06-28) fixes a problem that your error_log/standard_error_message will not see any ConflictError. While it is correct that the error_log/standard_error_message should not see ConflictErrors that are retried; it should see (and if configured correspondingly log) the ConflictErrors that go out to the user. With this fix, you do not need special handling (e.g. logging) of ConflictErrors that go out to the user. They can (and should) just be handled as any other exception. Did the user actually see a ConflictError page? Usually not. ...which, as I suspect you agree with me, simple isn't a good enough answer ;-) Add the fix shown above -- and the really problematic ConflictErrors (those seen by your customer) are handled the same way as other exceptions seen by your customer (a good thing!). ... I would not be happy: it is about 5 %. Yeah, me neither, but it would be great to quantify all of this :-) But, you can't. It is very difficult to quantify statistics precisely... -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: How bad _are_ ConflictErrors
Florent Guillaume wrote at 2005-11-25 11:22 +0100: ... Guess what, I know that. But I want a real ConflictError, to see what useful info about involved objects I can log. The only thing you need to log is str(conflict_error_value). ConflictError does a good job to provide all available information via its __str__. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ConflictError shouldn't subclass Exception
Chris Withers wrote at 2005-11-24 19:34 +: ... and I firmly agree with, that zodb conflicts should _not_ sublcass exception. -1 That way, there's less chance of them being caught by inexperienced programmers putting in try: except Exception: 's. Most people that use an unrestricted try ... except ... use try: ... except: ... and not try: ... except Exception: ..., thus your proposal will not help much... How would we go about making this change? Do not do it at all. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] buildbot failure in Zope trunk 2.4 Linux zc-buildbot
The Buildbot has detected a failed build of Zope trunk 2.4 Linux zc-buildbot. Buildbot URL: http://buildbot.zope.org/ Build Reason: changes Build Source Stamp: 1820 Blamelist: efge BUILD FAILED: failed test sincerely, -The Buildbot ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope-2.8.4 Problem with Plone-2.1.1
I am running Plone-2.1.1. I recently upgraded from zope-2.8.3 to zope-2.8.4 with no apparent issues. However, today when I attempted to view the properties of the Document content type within portal_types, i.e. I used a URL ending with /portal_types/Document/manage_propertiesForm. I received the following error message. The problem happened with all the content types, not just this one. I switched back to zope-2.8.3 and the problem went away. Just so you know. Does this need reporting as a bug? If so, does it go to the zope collector or the plone collector? Something similar was reported ages ago with zope-2.6.3 and CMF, but it may not be related. Traceback (most recent call last): File /opt/zope/lib/python/ZPublisher/Publish.py, line 113, in publish request, bind=1) File /opt/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply if debug is not None: return debug(object,args,context) File /opt/zope/lib/python/ZPublisher/Publish.py, line 40, in call_object result=apply(object,args) # Type scr to step into published object. File /var/opt/zope/default/Products/CMFCore/utils.py, line 405, in manage_propertiesForm return form(self, REQUEST, *args, **my_kw) File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 311, in __call__ return self._bindAndExec(args, kw, None) File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 348, in _bindAndExec return self._exec(bound_data, args, kw) File /opt/zope/lib/python/App/special_dtml.py, line 175, in _exec try: result = render_blocks(self._v_blocks, ns) File /opt/zope/lib/python/DocumentTemplate/DT_In.py, line 703, in renderwob try: append(render(section, md)) File /opt/zope/lib/python/DocumentTemplate/DT_Let.py, line 76, in render return render_blocks(self.section, md) File /opt/zope/lib/python/DocumentTemplate/DT_Util.py, line 196, in eval return eval(code, d) File string, line 0, in ? AttributeError: min Tony Addyman -- Eur Ing A.M.Addyman, School of Computing, Science and Engineering University of Salford, Salford, M5 4WT ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: More events
Florent Guillaume wrote: I've made changes so that Five and (Zope 2.9 Zope 2 trunk) send IContainerModifiedEvents when appropriate. These events are new in Zope 3.2, and subclass IObjectModifiedEvents. This is of course available in Five 1.2 and Five 1.3. I still have to stich in a snapshot of Five 1.3 into Zope 2.9 and Zope 2 trunk to make them work. I'll do that later today. Done. Phew. As some of you may know, it's a pain to merge from different repositories. A few BBB are left in Five and Zope because I didn't realize 2.9 and 2 trunk were tracking Zope 3.2 trunk. I'll remove them later. Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Zope-2.8.4 Problem with Plone-2.1.1
Put it in the Plone issue tracker, and we'll have a look at it. PS: Don't cross-post to lists when you want to ask several lists about the same - post individual messages, a lot of people don't like cross-posting. (Personally I don't really care, but... :) -- Alexander On Fri, 25 Nov 2005 13:33:11 -0800, Tony Addyman [EMAIL PROTECTED] wrote: I am running Plone-2.1.1. I recently upgraded from zope-2.8.3 to zope-2.8.4 with no apparent issues. However, today when I attempted to view the properties of the Document content type within portal_types, i.e. I used a URL ending with /portal_types/Document/manage_propertiesForm. I received the following error message. The problem happened with all the content types, not just this one. I switched back to zope-2.8.3 and the problem went away. Just so you know. Does this need reporting as a bug? If so, does it go to the zope collector or the plone collector? Something similar was reported ages ago with zope-2.6.3 and CMF, but it may not be related. Traceback (most recent call last): File /opt/zope/lib/python/ZPublisher/Publish.py, line 113, in publish request, bind=1) File /opt/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply if debug is not None: return debug(object,args,context) File /opt/zope/lib/python/ZPublisher/Publish.py, line 40, in call_object result=apply(object,args) # Type scr to step into published object. File /var/opt/zope/default/Products/CMFCore/utils.py, line 405, in manage_propertiesForm return form(self, REQUEST, *args, **my_kw) File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 311, in __call__ return self._bindAndExec(args, kw, None) File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 348, in _bindAndExec return self._exec(bound_data, args, kw) File /opt/zope/lib/python/App/special_dtml.py, line 175, in _exec try: result = render_blocks(self._v_blocks, ns) File /opt/zope/lib/python/DocumentTemplate/DT_In.py, line 703, in renderwob try: append(render(section, md)) File /opt/zope/lib/python/DocumentTemplate/DT_Let.py, line 76, in render return render_blocks(self.section, md) File /opt/zope/lib/python/DocumentTemplate/DT_Util.py, line 196, in eval return eval(code, d) File string, line 0, in ? AttributeError: min Tony Addyman -- _ Alexander Limi · Chief Architect · Plone Solutions · Norway Consulting · Training · Development · http://www.plonesolutions.com _ Plone Co-Founder · http://plone.org · Connecting Content Plone Foundation · http://plone.org/foundation · Protecting Plone ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] DateTime mess
Peter Bengtsson wrote: -1 on making DateTime deprecated. I'm sure thousands of zope people use DateTime in thousands of places. Technically it might be correct deprecate it but politically it's just going to put people off from upgrading. I'm sure it would be fairly trivial to write an unpgrader, but really, deprecating it, even if the deprecation period is fairly long, is the only sane way to tackle this... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DateTime mess
Lennart Regebro wrote: It depends on what you mena with deprecated. It *is* deprecated from the point of view, that if you start developing something new now, then don't use it. Really? What should we be using instead then? It is not deprecated in the way that this will go away in the future, though. It must stay for backwards compatibility reasons, but if it can be fixed, than this would be a Good Thing. I honestly think it _should_ go away, just with plenty of notice... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] 120MB file import failures
Michael Dexter wrote: I apologize if this is a FAQ, I could not find the answer. I would like to put a 120MB file into ZODB and it is constantly failing. Have a look at Tramlines from Infrae... cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DateTime mess
On 11/25/05, Chris Withers [EMAIL PROTECTED] wrote: Really? What should we be using instead then? datetime works much better in most cases. I honestly think it _should_ go away, just with plenty of notice... Well, possibly. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Creating a DTM Document in a variable folder.
Hello, I don'thave any Python experience yet, so who has a solution for this 'problem'. Example: I 've 3 folders a, b c. I want to create a dtml document in a folder by a form. The folder is a variable in my form. The formis no problem, the form action is no problem. The python script to craete that document is my problem. How can I create a DTM Document in a variable container ? Regards, Martin Koekenberg ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Psycopg export/import
As part of an object, I have exported several zsql methods from Zope 2.2.2 and imported to Zope 2.6.2. In the later version I am using Psycopg as a database connection to Postgres. It is working fine for all ZSQL methods I have created within 2.6.2. However, the methods I imported from Zope 2.2.2 do not connect to the database. Message is Warning: The database connection for this method cannot be found!. However, the Connection ID is shown and all appears to be in place. An ideas? Thanks in advance. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Creating a DTM Document in a variable folder.
folder = getattr(context, 'b') adder = folder.manage_addProduct['OFSP'].methodAdd adder('index.html', 'Some title') That creates it with default content. To change it you'll have to call dtmlm = getattr(context, 'index.html') dtmlm.manage_edit(bla bla bla bla bla, 'Same title') # or f = open('/tmp/foobar.html') dtmlm.manage_upload(f) On 11/25/05, Martin Koekenberg [EMAIL PROTECTED] wrote: Hello, I don't have any Python experience yet, so who has a solution for this 'problem'. Example: I 've 3 folders a, b c. I want to create a dtml document in a folder by a form. The folder is a variable in my form. The formis no problem, the form action is no problem. The python script to craete that document is my problem. How can I create a DTM Document in a variable container ? Regards, Martin Koekenberg ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DateTime mess
If I have a vote, +1 on deprecation and replacement with something less buggy. We have spent enormous amounts of time trying to sort out and then work around DateTime problems. On the other hand, we have a substantial amount of code that uses DateTime and finally, mostlyt works. We'd be unhappy if we had to rewrite everything--so a long deprecation period makes sense. Timezones, BTW are just the tip of the iceberg. Datetime tries to be a it just works solution to an inherently ambiguous problem and incorporates many surprises. On Fri, 25 Nov 2005, Chris Withers wrote: Peter Bengtsson wrote: -1 on making DateTime deprecated. I'm sure thousands of zope people use DateTime in thousands of places. Technically it might be correct deprecate it but politically it's just going to put people off from upgrading. I'm sure it would be fairly trivial to write an unpgrader, but really, deprecating it, even if the deprecation period is fairly long, is the only sane way to tackle this... cheers, Chris -- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DateTime mess
--On 25. November 2005 12:22:05 -0800 Dennis Allison [EMAIL PROTECTED] wrote: If I have a vote, +1 on deprecation and replacement with something less buggy. You can only deprecate when you have something better. As long as there is no useful replacemenet there is nothing to deprecate :-) -aj pgpZFxKrRNRkb.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DateTime mess
True. But the context of this thread was whether deprecation made sense or not. I was agreeing with Chris that the DateTime problems are better solved by replacement than by patching, but also that there is a large amount of code that has been made to work using the current DataTime and that investment needs to be protected. On Fri, 25 Nov 2005, Andreas Jung wrote: --On 25. November 2005 12:22:05 -0800 Dennis Allison [EMAIL PROTECTED] wrote: If I have a vote, +1 on deprecation and replacement with something less buggy. You can only deprecate when you have something better. As long as there is no useful replacemenet there is nothing to deprecate :-) -aj -- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Psycopg export/import
William Herring wrote at 2005-11-25 11:31 -0500: ... However, the methods I imported from Zope 2.2.2 do not connect to the database. Message is Warning: The database connection for this method cannot be found!. However, the Connection ID is shown and all appears to be in place. Where is this message? Comes it from an exception? If so, with what traceback? -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] 120MB file import failures
Michael Dexter wrote at 2005-11-24 11:49 -0800: I apologize if this is a FAQ, I could not find the answer. I would like to put a 120MB file into ZODB and it is constantly failing. But you should have learned that you cannot simply say is failing but must describe precisely (error information, traceback) *how* it is failing... -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] DateTime mess
--On 25. November 2005 12:43:48 -0800 Dennis Allison [EMAIL PROTECTED] wrote: True. But the context of this thread was whether deprecation made sense or not. I was agreeing with Chris that the DateTime problems are better solved by replacement than by patching, but also that there is a large amount of code that has been made to work using the current DataTime and that investment needs to be protected. I agree that is should be replaced but I also mentioned that we tried to achieve that already some years ago and we gave upso talking about deprecation really makes sense when someone puts a replacement module on the table. I know that the DateTime module is a piece of crap but crap you can live mostly with (as long as you don't need timezones :-)). -aj pgpdFwef5JG6A.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )