Heads up: about to merge new-style ExtensionClass and ZODB 3.3 into Zope 2 head
Hi, I'm just about to start writing the checkin logs for the merge of new-style ExtensionClass and ZODB 3.3 into the Zope 3 head. I expect the merge to be done within the next hour or two. Except for a test failure and some warnings pre-existing on the head, all of the tests and Zope runs. This is a huge change though and I expect this to be the beginning of a period of relative instability. Hoepfully, we can all work together to quickly address whatever problems come up. As I mentioned in another message, old Zope 2 databases won't work on the head for a while until I have a chance to come up with a mechanism for converting ancient BTrees and intSets. Unfortunately, until a change I checked into the Zope 2.7 branch on Wednesday, Zope was continuing to use the old depricated BTrees for a key data structure. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
On Fri, 2003-11-28 at 09:59, Jim Fulton wrote:
Hi,
I'm just about to start writing the checkin logs for the merge of new-style ExtensionClass and ZODB 3.3 into the Zope 3 head. I expect the merge to be done within the next hour or two.
You mean the Zope 2 HEAD, correct?
Chris McDonough wrote:
On Fri, 2003-11-28 at 09:59, Jim Fulton wrote:
Hi,
I'm just about to start writing the checkin logs for the merge of new-style ExtensionClass and ZODB 3.3 into the Zope 3 head. I expect the merge to be done within the next hour or two.
You mean the Zope 2 HEAD, correct?
Oops, yes. :) Thanks. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
Jim Fulton wrote:
Hi,
I'm just about to start writing the checkin logs for the merge of new-style ExtensionClass and ZODB 3.3 into the Zope 2 head. I expect the merge to be done within the next hour or two.
Done! Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
Jim Fulton wrote:
Done!
Hi Jim! Here some feedback regarding your checkin. I tested CMF with Zope HEAD. These are the issues I ran into: 1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore Maybe Zope 2.7 should have a deprecation warning? 2.) assignment to class dictionaries doesn't work anymore I copied your fix for ZopePageTemplate to FSPageTemplate. Now Zope started again. 3.) 'rebinding by assignment' doesn't work anymore With oldstyle ExtensionClasses you were able to rebind methods by assignment, without subclassing from the class that defines the method. CMFCore/FSPageTemplate.py seems to be a good use case for that feature: class FSPageTemplate(FSObject, Script, PageTemplate): pt_getContext = ZopePageTemplate.pt_getContext This works fine with Zope 2.7, but raises an error with Zope HEAD: TypeError: unbound method pt_getContext() must be called with ZopePageTemplate instance as first argument (got nothing instead) I fixed this one and now a CMF Site seems to work, but I'm afraid this pattern is used in other places. The unittests show this: TypeError: unbound method manage_addPortalFolder() must be called with PortalFolder instance as first argument (got str instance instead) 4.) some objects publishable in Zope 2.7 aren't publishable anymore No big deal to add docstrings, but what's the policy change? 5.) other issues I was not able to track this error down, but maybe you've got an idea what's going wrong here? http://localhost:8080/myCMFSite/portal_types/Document/manage_propertiesForm Traceback (innermost last): Module ZPublisher.Publish, line 100, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Products.CMFCore.utils, line 350, in manage_propertiesForm Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 281, in _bindAndExec Module Shared.DC.Scripts.Bindings, line 1, in ? Module Shared.DC.Scripts.Bindings, line 218, in _getContext AttributeError: aq_parent Cheers, Yuppie
Yuppie wrote:
Jim Fulton wrote:
Done!
Hi Jim!
Here some feedback regarding your checkin.
Thanks!
I tested CMF with Zope HEAD. These are the issues I ran into:
1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore
Maybe Zope 2.7 should have a deprecation warning?
Hm, or maybe we should make this work for zodb. Jeremy, what do you think?
2.) assignment to class dictionaries doesn't work anymore
I copied your fix for ZopePageTemplate to FSPageTemplate. Now Zope started again.
Right. I don't see an easy way around this.
3.) 'rebinding by assignment' doesn't work anymore
With oldstyle ExtensionClasses you were able to rebind methods by assignment, without subclassing from the class that defines the method.
CMFCore/FSPageTemplate.py seems to be a good use case for that feature:
class FSPageTemplate(FSObject, Script, PageTemplate): pt_getContext = ZopePageTemplate.pt_getContext
Hm, this seems lame.
This works fine with Zope 2.7,
Hm, I'm surprised.
but raises an error with Zope HEAD:
TypeError: unbound method pt_getContext() must be called with ZopePageTemplate instance as first argument (got nothing instead)
This is consistent with standard Python behavior:
class X: ... def foo(self): pass ... class Y: ... foo = X.foo ... y = Y() y.foo() Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: unbound method foo() must be called with X instance as first argument (got nothing instead)
So I'm inclined to consider the new behavior correct.
I fixed this one and now a CMF Site seems to work, but I'm afraid this pattern is used in other places. The unittests show this:
TypeError: unbound method manage_addPortalFolder() must be called with PortalFolder instance as first argument (got str instance instead)
Dang, I should have tested CMF with 2.8.
4.) some objects publishable in Zope 2.7 aren't publishable anymore
Can you give any specifics?
No big deal to add docstrings, but what's the policy change?
For better or worse, it has always been policy not to publish objects without non-empty doc strings.
5.) other issues
I was not able to track this error down, but maybe you've got an idea what's going wrong here?
http://localhost:8080/myCMFSite/portal_types/Document/manage_propertiesForm Traceback (innermost last): Module ZPublisher.Publish, line 100, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Products.CMFCore.utils, line 350, in manage_propertiesForm Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 281, in _bindAndExec Module Shared.DC.Scripts.Bindings, line 1, in ? Module Shared.DC.Scripts.Bindings, line 218, in _getContext AttributeError: aq_parent
Not off-hand. I'll chase this down if no one else does. I'd really appreciate some help with this. In other words, I'd really like others to pick these issues up and run with them. I did the hard part. It took me a good bit of time stolen from Zope 3. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
Hi Jim! Jim Fulton wrote:
I tested CMF with Zope HEAD. 1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore 2.) assignment to class dictionaries doesn't work anymore
These two are now fixed in CMF HEAD. So whoever wants to have a look at the other issues: Tests and Zope are running again with CMF installed.
3.) 'rebinding by assignment' doesn't work anymore [...] This is consistent with standard Python behavior: [...] So I'm inclined to consider the new behavior correct.
Correct or not: This is a backwards compatibility issue. I also found this one: http://localhost:8080/Control_Panel/Database/main/manage_main unbound method db_name() must be called with ApplicationManager instance as first argument (got nothing instead) You already didn't switch to the new mro to make migration easier. If it is possible to give newstyle ExtensionClasses the old rebinding behavior I'd vote for that. If not, people need some advice how to update their products: - How do I find code depending on the old behavior? - How do I fix that code? (I know I can copy 'n' paste the code I want to reuse from other classes, but is there a better way to reuse code without subclassing?)
4.) some objects publishable in Zope 2.7 aren't publishable anymore
Can you give any specifics?
Zope Core: http://localhost:8080/temp_folder http://localhost:8080/Control_Panel/DavLocks CMF: http://localhost:8080/myCMFSite/portal_skins/zpt_generic http://localhost:8080/myCMFSite/portal_workflow/default_workflow
No big deal to add docstrings, but what's the policy change?
For better or worse, it has always been policy not to publish objects without non-empty doc strings.
That's what I thought. But it seems like Zope 2.7 doesn't catch them all. Cheers, Yuppie
I worked a bit with ZopeHead. Required CMF patches attached. Jim Fulton wrote at 2003-11-30 11:28 -0500:
Jim Fulton wrote:
Yuppie wrote: 1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore
"Persistent" was moved from ZODB into "Persistence". Had to modify DC-Workflow.
...
3.) 'rebinding by assignment' doesn't work anymore
With oldstyle ExtensionClasses you were able to rebind methods by assignment, without subclassing from the class that defines the method.
CMFCore/FSPageTemplate.py seems to be a good use case for that feature:
class FSPageTemplate(FSObject, Script, PageTemplate): pt_getContext = ZopePageTemplate.pt_getContext
This is still possible but only for subclasses of assigned methods. Appending ".im_func" removes this restriction.
...
4.) some objects publishable in Zope 2.7 aren't publishable anymore
Can you give any specifics?
No big deal to add docstrings, but what's the policy change?
Apparently, the old "ExtensionClass" was ready to inherit "__doc__" from a base class. Python 2.3 does not do this. Thus, "__doc__" strings have to be added...
5.) other issues
I was not able to track this error down, but maybe you've got an idea what's going wrong here?
http://localhost:8080/myCMFSite/portal_types/Document/manage_propertiesForm Traceback (innermost last): Module ZPublisher.Publish, line 100, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Products.CMFCore.utils, line 350, in manage_propertiesForm Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 281, in _bindAndExec Module Shared.DC.Scripts.Bindings, line 1, in ? Module Shared.DC.Scripts.Bindings, line 218, in _getContext AttributeError: aq_parent
It is very obscure, indeed. Not that is does not work in "Zope 2.8" but that it worked in previous versions: "PropertyManager.manage_propertiesForm" ("mpF") is an "App.special_dtml.DTMLFile" instance. In "Products.CMFCore.utils.SimpleItemWithProperties.manage_propertiesForm" it is called by apply(mpF, (self, self, REQUEST,) ...) Apparently, former versions used the first "self" as "self" for the "DTMLFile" and passed the remaining arguments to "mpF"s "__call__", which seems really strange. Zope 2.8 does the natural thing: it does not change the "mpF"s "self" and passed all arguements to "__call__". As "mpF"s "self" is not acquisition wrapped, we get the "aq_parent" error. A fix calls "mpF" by: apply(mpF.__of__(self), (self, REQUEST,) ...) The attached patch to "CMFCore" fixes all CMF test failures with the exception of 2 ".security" errors. These are not related to Zope 2.8 but genuine bugs in my CMF 1.4.1 installation. -- Dieter
| >1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore | > | >Maybe Zope 2.7 should have a deprecation warning? | | Hm, or maybe we should make this work for zodb. Jeremy, what do you think? What has been decided about this? I notice Yuppie changed the imports to 'from Globals import PersistentMapping'. Any objection to add 'PersistentList' to 'Globals' as well and checking it in head, 2.7 and 2.6? []'s -- Sidnei da Silva <sidnei@awkly.org> http://awkly.org - dreamcatching :: making your dreams come true http://plone.org/about/team#dreamcatcher I do not fear computers. I fear the lack of them. -- Isaac Asimov
In article <3FC762CB.6090701@zope.com> you write:
As I mentioned in another message, old Zope 2 databases won't work on the head for a while until I have a chance to come up with a mechanism for converting ancient BTrees and intSets.
Could you define "ancient"? Since what version have "recent" BTrees been used in Zope? Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
Florent Guillaume wrote:
In article <3FC762CB.6090701@zope.com> you write:
As I mentioned in another message, old Zope 2 databases won't work on the head for a while until I have a chance to come up with a mechanism for converting ancient BTrees and intSets.
Could you define "ancient"?
In this case, more than 2 years,
Since what version have "recent" BTrees been used in Zope?
2.3. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
participants (6)
-
Chris McDonough -
Dieter Maurer -
Florent Guillaume -
Jim Fulton -
Sidnei da Silva -
Yuppie