[Zope] Zope 2.8.0 monkey patch issue

2005-06-13 Thread Pascal Peregrina
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

This was working fine in Zope 2.7.x

Any idea what could have changed that would imply this ?

Thanks for your answers.

Pascal


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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] Zope 2.8.0 monkey patch issue

2005-06-13 Thread 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



This was working fine in Zope 2.7.x

Any idea what could have changed that would imply this ?

Thanks for your answers.

Pascal


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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 )


___
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] Zope 2.8.0 monkey patch issue

2005-06-13 Thread Tino Wildenhain
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 scr 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.



___
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] Zope 2.8.0 monkey patch issue

2005-06-13 Thread Pascal Peregrina
Thanks, that works !

Pascal

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de
Bernd Dorn
Envoyé : lundi 13 juin 2005 12:26
À : 'zope@zope.org'
Objet : Re: [Zope] Zope 2.8.0 monkey patch issue


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

 
 This was working fine in Zope 2.7.x
 
 Any idea what could have changed that would imply this ?
 
 Thanks for your answers.
 
 Pascal
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 
 www.mimesweeper.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 )

___
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 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 )