Am Montag, den 13.06.2005, 12:26 +0200 schrieb Bernd Dorn:
Pascal Peregrina wrote:
Hi,
I am trying to migrate from Zope 2.7.6 to 2.8.0
In some product I did, I need to monkey patch some OFS and CMF classes (I do this in product init).
I get this error whenever I try to do <someclass>.__dict__[<someclassattributename>]=<newvalue> : TypeError: object does not support item assignment
'got the same problem
use: setattr(<someclass>,<someclassattributename>,<newvalue>)
must be something about the new implementation of extensionclass
Yes, something... I wonder whats the difference - since I do it similar (setattr) in my history monkey patch. However in 2.8: Traceback (innermost last): Module ZPublisher.Publish, line 113, in publish 111 | missing_name, 112 | dont_publish_class, 113>| request, bind=1) 114 | 115 | if result is not response: Module ZPublisher.mapply, line 88, in mapply 086 | 087 | args=tuple(args) 088>| if debug is not None: return debug(object,args,context) 089 | else: return object(*args) Module ZPublisher.Publish, line 40, in call_object 038 | 039 |def call_object(object, args, request): 040>| result=apply(object,args) # Type s<cr> to step into published object. 041 | return result 042 | Module Shared.DC.Scripts.Bindings, line 311, in __call__ 309 | def __call__(self, *args, **kw): 310 | '''Calls the script.''' 311>| return self._bindAndExec(args, kw, None) 312 | 313 | def __render_with_namespace__(self, namespace): Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec 346 | exec bindcode 347 | bound_data = bound_data[0] 348>| return self._exec(bound_data, args, kw) 349 | finally: 350 | security.removeContext(self) Module App.special_dtml, line 175, in _exec 173 | value = self.ZDocumentTemplate_beforeRender(ns, _marker) 174 | if value is _marker: 175>| try: result = render_blocks(self._v_blocks, ns) 176 | except DTReturn, v: result = v.v 177 | except AttributeError: TypeError: unbound method manage_change_history() must be called with Historical instance as first argument (got nothing instead) The patch is available here: http://www.zope.org/Members/tino/PatchHistory/view if someone likes to try.