[Zope-dev] Re: 2.7 assertion with CVS of this morning

2004-03-11 Thread leo
I seem to have a similar problem when using external editor on an 
archetype's RichWidget TextField :

#  Module ZPublisher.Publish, line 163, in publish_module_standard
# Module Products.PlacelessTranslationService.PatchStringIO, line 45, in 
new_publish
# Module ZPublisher.Publish, line 127, in publish
# Module Zope.App.startup, line 203, in zpublisher_exception_hook
# 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.FSPythonScript, line 104, in __call__
# Module Shared.DC.Scripts.Bindings, line 306, in __call__
# Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
# Module Products.CMFCore.FSPythonScript, line 160, in _exec
# Module None, line 2, in external_edit
FSPythonScript at /daatep/external_edit
Line 2

or using it's view property :

#  Module ZPublisher.Publish, line 163, in publish_module_standard
# Module Products.PlacelessTranslationService.PatchStringIO, line 45, in 
new_publish
# Module ZPublisher.Publish, line 127, in publish
# Module Zope.App.startup, line 203, in zpublisher_exception_hook
# Module ZPublisher.Publish, line 94, in publish
# Module Zope.App.startup, line 257, in recordMetaData
# Module OFS.SimpleItem, line 333, in getPhysicalPath
# Module OFS.SimpleItem, line 76, in lambda
# Module OFS.SimpleItem, line 310, in getId
# Module OFS.SimpleItem, line 76, in lambda

My question is :
could you be more explicit as to what your solution is.
I do not find a _NEED_WRAPPING anywhere not even in 
AccessControl.Implementation ?

using  (unreleased version, python 2.3.3, linux2)
zope-2_7_0
Thanks

Léo

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of that morning two days ago

2004-01-15 Thread Clemens Robbenhaar

Hi Robert,

  Hi Tres,
  Adding 'guarded_hasattr' to the list of items wrapped items did not help.
  

 I guess You have taken Tres too literally. I did the same (i.e. adding
the string 'guarded_hasattr' to the _NEED_WRAPPING list) and could
reproduce Your issue. After wandering through the code a while I think
Tres meant the function guarded_hasattr to be registered under the
name hasattr ...
 
  I do not really understand what happens.
  

 I don't either, but the follwing works for me :)

diff -w -u -r1.1.2.2 Implementation.py
--- AccessControl/Implementation.py 12 Jan 2004 23:58:39 -  1.1.2.2
+++ AccessControl/Implementation.py 15 Jan 2004 18:38:34 -
@@ -92,7 +92,7 @@
 from DocumentTemplate import DT_Util
 from ZopeGuards import safe_builtins
 
-_NEED_WRAPPING = ('max', 'min', 'iter', 'enumerate', 'sum')
+_NEED_WRAPPING = ('max', 'min', 'iter', 'enumerate', 'sum', 'hasattr')
 
 for k, v in safe_builtins.items():
 if k in _NEED_WRAPPING:


Chers,
Clemens

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of that morning two days ago

2004-01-15 Thread robert
Thanks,
Yuppie allredy pointed me to my error. Things work fine now.
Strange that this is not yet fixed in the CVS.
Robert
The only thing I am still figthing: LocalFS does not work under 2.7. You do 
not happen to know how to fix it?

On Thursday 15 January 2004 19:45, Clemens Robbenhaar wrote:
 Hi Robert,

   Hi Tres,
   Adding 'guarded_hasattr' to the list of items wrapped items did not
   help.

  I guess You have taken Tres too literally. I did the same (i.e. adding
 the string 'guarded_hasattr' to the _NEED_WRAPPING list) and could
 reproduce Your issue. After wandering through the code a while I think
 Tres meant the function guarded_hasattr to be registered under the
 name hasattr ...

   I do not really understand what happens.

  I don't either, but the follwing works for me :)

 diff -w -u -r1.1.2.2 Implementation.py
 --- AccessControl/Implementation.py 12 Jan 2004 23:58:39 - 
 1.1.2.2 +++ AccessControl/Implementation.py 15 Jan 2004 18:38:34 -
 @@ -92,7 +92,7 @@
  from DocumentTemplate import DT_Util
  from ZopeGuards import safe_builtins

 -_NEED_WRAPPING = ('max', 'min', 'iter', 'enumerate', 'sum')
 +_NEED_WRAPPING = ('max', 'min', 'iter', 'enumerate', 'sum', 'hasattr')

  for k, v in safe_builtins.items():
  if k in _NEED_WRAPPING:


 Chers,
 Clemens

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 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 maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of this morning

2004-01-14 Thread Yuppie
Hi Robert!

robert wrote:
I found this,
however 'has_order_support' is not the third argument.
That is why I do not unterstand what happens.
[...]
_.hasattr(this().aq_self, 'has_order_support')
I don't know that code very well, but this is how I understand what happens:

All names in the TemplateDict are bound as methods. If you call hasattr 
the TemplateDict ('self') is passed in as first argument, in our case 
'has_order_support' becomes the third argument. To avoid this functions 
need to be wrapped by NotBindable.

Did you see my other mail? Adding 'hasattr' (not 'guarded_hasattr') to 
_NEED_WRAPPING works for me.

Cheers,
Yuppie


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of this morning

2004-01-14 Thread robert
On Wednesday 14 January 2004 09:20, Yuppie wrote:
 Did you see my other mail? Adding 'hasattr' (not 'guarded_hasattr') to
 _NEED_WRAPPING works for me.

Thanks for the clarification. Now it works.

Robert


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of this morning

2004-01-13 Thread Tres Seaver
robert wrote:
I refreshed my 2.7 from CVS this morning (7.30 MEZ) and get the following 
traceback:
This is my bad, I'm pretty sure.  Was this just trying to get into the 
ZMI, or was there another application / template which triggered the 
problem?  At any rate, the fix is likely to be to add 'guarded_hasattr' 
to the list of items which should be wrapped;  on the 2.7 branch, this 
list is at the bottom of AccessControl.Implementation.

Robert

Site Error
An error was encountered while publishing this resource.

TypeError
Sorry, a site error occurred.
Traceback (innermost last):

* Module ZPublisher.Publish, line 163, in publish_module_standard
* Module Products.PlacelessTranslationService.PatchStringIO, line 45, in 
new_publish
* Module ZPublisher.Publish, line 127, in publish
* Module Zope.App.startup, line 203, in zpublisher_exception_hook
* Module ZPublisher.Publish, line 100, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 40, in call_object
* Module Shared.DC.Scripts.Bindings, line 261, in __call__
* Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec
* Module App.special_dtml, line 175, in _exec
* Module DocumentTemplate.DT_Let, line 75, in render
* Module DocumentTemplate.DT_Util, line 201, in eval
  __traceback_info__: _
* Module string, line 0, in ?

TypeError: guarded_hasattr() takes exactly 2 arguments (3 given) (Also, an 
error occurred while attempting to render the standard error message.)
Tres.
--
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of this morning

2004-01-13 Thread Yuppie
robert wrote:
I grepped for has_order_support to find out where this happens, but did not 
find it.
The Zope 2.7 main.dtml has this code:

_.hasattr(this().aq_self, 'has_order_support')

HTH, Yuppie



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of this morning

2004-01-13 Thread Yuppie
Tres Seaver wrote:
This is my bad, I'm pretty sure.  Was this just trying to get into the 
ZMI, or was there another application / template which triggered the 
problem?  At any rate, the fix is likely to be to add 'guarded_hasattr' 
to the list of items which should be wrapped;  on the 2.7 branch, this 
list is at the bottom of AccessControl.Implementation.
Yes. Adding 'hasattr' (the key for guarded_hasattr) to _NEED_WRAPPING 
seems to fix this issue.

Cheers,
Yuppie


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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: 2.7 assertion with CVS of this morning

2004-01-13 Thread robert
I found this,
however 'has_order_support' is not the third argument.
That is why I do not unterstand what happens.
Robert

On Tuesday 13 January 2004 23:58, Yuppie wrote:
 robert wrote:
  I grepped for has_order_support to find out where this happens, but did
  not find it.

 The Zope 2.7 main.dtml has this code:

 _.hasattr(this().aq_self, 'has_order_support')


 HTH, Yuppie



 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 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 maillist  -  [EMAIL PROTECTED]
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 )