Re: [Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
"Dr. Ross Lazarus" wrote: > > Shane - it's a shocking thing to post untested patches - particularly > when they work > I just tested this quickly on 2.1.6 and 22b3 and it seems fine. Thank > you!. That's why he gets paid the big bucks ;) > Ok, what's the way forward here - how do we make sure that a 2.2 clean > CalendarTag product appears in the Products download area on zope.org??? Get the patch to the maintainer. > How do we make sure every product available for download on zope.org is > clearly marked as either untested for 2.2; broken in 2.2; 2.2 clean - > otherwise many new zope users are going to be tearing their hair out > patching stuff or giving up in disgust??? Who's going to go through each > one and patch it as needed? The owners/maintainers? Seriously, that's who I see as responsible for that. A general warning on the Products page indicating that due to tighter security, osm eolder products may not work well, if at all, with the new 2.2, followed by the mainainer indicating if they have tested/fixed, will/will-not support it on 2.2, etc. Should be fine, IMO. Bill -- "Linux: the operating system with a CLUE... Command Line User Environment". seen in a posting on comp.software.testing ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
Shane - it's a shocking thing to post untested patches - particularly when they work I just tested this quickly on 2.1.6 and 22b3 and it seems fine. Thank you!. Ok, what's the way forward here - how do we make sure that a 2.2 clean CalendarTag product appears in the Products download area on zope.org??? How do we make sure every product available for download on zope.org is clearly marked as either untested for 2.2; broken in 2.2; 2.2 clean - otherwise many new zope users are going to be tearing their hair out patching stuff or giving up in disgust??? Who's going to go through each one and patch it as needed? The calendar tag is a good example - probably lots of folks out there using it - all are going to be bitten by this when they upgrade to 2.2x? > I haven't tried this, but I think if you change the "self" argument in > the namespace() call from CalendarTag to "md", the problem will be > resolved. I think that's what Ty meant to do, but the old mechanism > didn't care; it didn't even look at the first argument. In other words: > > > > > ns = namespace(md, > > > > date = date, > > > > mode = self.mode, > > > > firstday = firstday, > > > > setCalendar = self.setCalendar_, > > > > getCalendar = self.getCalendar_, > > > > linkDate = self.linkDate_ > > > > )[0] > > Of course, it's kinda crazy for me to be sending out untested patches to > other people's work. :-) But if this works, it will also be > backwards-compatible. > > Shane -- Dr Ross Lazarus Associate Professor and Sub-Dean for Information Technology Faculty of Medicine, Room 126A, A27, University of Sydney, Camperdown, NSW 2006, Australia Tel: (+61 2) 93514429 Mobile: +61414872482 Fax: (+61 2) 93516646 Email: [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
"Dr. Ross Lazarus" wrote: > > > The offending line in CalendarTag.py is > > > > > > ns = namespace(self, > > > date = date, > > > mode = self.mode, > > > firstday = firstday, > > > setCalendar = self.setCalendar_, > > > getCalendar = self.getCalendar_, > > > linkDate = self.linkDate_ > > > )[0] I haven't tried this, but I think if you change the "self" argument in the namespace() call from CalendarTag to "md", the problem will be resolved. I think that's what Ty meant to do, but the old mechanism didn't care; it didn't even look at the first argument. In other words: > > > ns = namespace(md, > > > date = date, > > > mode = self.mode, > > > firstday = firstday, > > > setCalendar = self.setCalendar_, > > > getCalendar = self.getCalendar_, > > > linkDate = self.linkDate_ > > > )[0] Of course, it's kinda crazy for me to be sending out untested patches to other people's work. :-) But if this works, it will also be backwards-compatible. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
"Dr. Ross Lazarus" wrote: > The point that I find hard to understand is that namespace in DT_Util > has changed from 2.1.6 as follows > > ===2.1.6== > class namespace_: > pass > > def namespace(self, **kw): > """Create a tuple consisting of a single instance whos attributes > are > provided as keyword arguments.""" > r=namespace_() > d=r.__dict__ > for k, v in kw.items(): d[k]=v > return r, > > 2.2.0b3 > class namespace_: > __allow_access_to_unprotected_subobjects__=1 > > def namespace(self, **kw): > """Create a tuple consisting of a single instance whos attributes > are > provided as keyword arguments.""" > return apply(self, (), kw) > > Now, I can easily put the old definition back and it might work - but > I'm not in a position to understand why the method has changed from what > looks like a simple dictionary construction to the apply function - > which doesn't seem to have anything to do with the namespace_ class !! In Zope 2.1.6 and before we had two ways of creating a new namespace: _() and _.namespace(). The former was implemented in C and the latter was in Python, but they did virtually the same thing (and there certainly wasn't any reason to believe they should do anything different.) So we merged the two implementations into one by causing the namespace() method to call the _() method, implemented in cDocumentTemplate.py. AFAIK the namespace_ class definition was left in by accident. It now does absolutely nothing. There have been more problems with the merge than expected. But we are engineers--the last thing we want is code bloat by reverting to the old method. Instead we'd like to get bugs truly corrected. So I'll plan to look into this problem. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
Thanks for the help. Summary: CalendarTag works fine in 2.1.6 but is broken in 2.20b3. __call__ is mapped to render(self,md) - this is the same for all dtml tags AFAIK. The point that I find hard to understand is that namespace in DT_Util has changed from 2.1.6 as follows ===2.1.6== class namespace_: pass def namespace(self, **kw): """Create a tuple consisting of a single instance whos attributes are provided as keyword arguments.""" r=namespace_() d=r.__dict__ for k, v in kw.items(): d[k]=v return r, 2.2.0b3 class namespace_: __allow_access_to_unprotected_subobjects__=1 def namespace(self, **kw): """Create a tuple consisting of a single instance whos attributes are provided as keyword arguments.""" return apply(self, (), kw) Now, I can easily put the old definition back and it might work - but I'm not in a position to understand why the method has changed from what looks like a simple dictionary construction to the apply function - which doesn't seem to have anything to do with the namespace_ class !! Brian?? Dieter Maurer wrote: > The "self", more precisely, its "__call__" gets the keyword > "linkDate" which it does not (no longer) likes to have. > > Dr. Ross Lazarus writes: > > Trying the new 2.2.0b3 zope. > > One zclass using ty's calendar tag now breaks with an error message I > > just cannot figure out - > > > > Error Type: TypeError > > Error Value: unexpected keyword argument: linkDate > > > > File /usr/local/zope/zope22b3/lib/python/DocumentTemplate/DT_Util.py, > > line 262, in namespace > > TypeError: (see above) > > > > I added __allow_access_to_unprotected_subobjects__=1 to the CalendarTag > > class just in case. > > > > The offending line in CalendarTag.py is > > > > ns = namespace(self, > > date = date, > > mode = self.mode, > > firstday = firstday, > > setCalendar = self.setCalendar_, > > getCalendar = self.getCalendar_, > > linkDate = self.linkDate_ > > )[0] > > > > > > namespace in DT_Util seems harmless enough - > > > > def namespace(self, **kw): > > """Create a tuple consisting of a single instance whos attributes are > > provided as keyword arguments.""" > > return apply(self, (), kw) > The "self", more precisely, its "__call__" gets the keyword > "linkDate" which it does not (no longer) likes to have. > > Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
Dr. Ross Lazarus writes: > Trying the new 2.2.0b3 zope. > One zclass using ty's calendar tag now breaks with an error message I > just cannot figure out - > > Error Type: TypeError > Error Value: unexpected keyword argument: linkDate > > File /usr/local/zope/zope22b3/lib/python/DocumentTemplate/DT_Util.py, > line 262, in namespace > TypeError: (see above) > > I added __allow_access_to_unprotected_subobjects__=1 to the CalendarTag > class just in case. > > The offending line in CalendarTag.py is > > ns = namespace(self, > date = date, > mode = self.mode, > firstday = firstday, > setCalendar = self.setCalendar_, > getCalendar = self.getCalendar_, > linkDate = self.linkDate_ > )[0] > > > namespace in DT_Util seems harmless enough - > > def namespace(self, **kw): > """Create a tuple consisting of a single instance whos attributes are > provided as keyword arguments.""" > return apply(self, (), kw) The "self", more precisely, its "__call__" gets the keyword "linkDate" which it does not (no longer) likes to have. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Calendar tag 0.9.6 breaks with 2.2.0b3??
Trying the new 2.2.0b3 zope. One zclass using ty's calendar tag now breaks with an error message I just cannot figure out - Error Type: TypeError Error Value: unexpected keyword argument: linkDate Traceback (innermost last): File /usr/local/zope/zope22b3/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/zope22b3/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/zope22b3/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: CatalogAware) File /usr/local/zope/zope22b3/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/zope22b3/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: updatePBLdates_calendar) File /usr/local/zope/zope22b3/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: updatePBLdates_calendar) File /usr/local/zope/zope22b3/lib/python/OFS/DTMLMethod.py, line 167, in __call__ (Object: updatePBLdates_calendar) File /usr/local/zope/zope22b3/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: updatePBLdates_calendar) File /usr/local/zope/zopeinstancehome/Products/Calendar/CalendarTag.py, line 277, in render File /usr/local/zope/zopeinstancehome/Products/Calendar/CalendarTag.py, line 313, in render_wm File /usr/local/zope/zopeinstancehome/Products/Calendar/CalendarTag.py, line 339, in render_day_ File /usr/local/zope/zope22b3/lib/python/DocumentTemplate/DT_Util.py, line 262, in namespace TypeError: (see above) I added __allow_access_to_unprotected_subobjects__=1 to the CalendarTag class just in case. The offending line in CalendarTag.py is ns = namespace(self, date = date, mode = self.mode, firstday = firstday, setCalendar = self.setCalendar_, getCalendar = self.getCalendar_, linkDate = self.linkDate_ )[0] namespace in DT_Util seems harmless enough - def namespace(self, **kw): """Create a tuple consisting of a single instance whos attributes are provided as keyword arguments.""" return apply(self, (), kw) Anyone ?? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )