[ZCM] [ZC] 1716/ 5 Comment "__bobo_traverse__ and ftp/webdav"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Tue Mar 1 12:22:08 EST 2005


Issue #1716 Update (Comment) "__bobo_traverse__ and ftp/webdav"
 Status Rejected, Zope/bug critical
To followup, visit:
  http://www.zope.org/Collectors/Zope/1716

==============================================================
= Comment - Entry #5 by mcdonc on Mar 1, 2005 12:22 pm

That will almost certainly do "the wrong thing" (although you don't say what you're trying to do).  If you define a __bobo_traverse__ on an object, it must return an object that the Publisher understands by its contract.  As you've defined it by passing, it returns None, which the publisher does not understand.
________________________________________
= Comment - Entry #4 by llonchj on Mar 1, 2005 12:16 pm

Can you try this code?

def __bobo_traverse__ (self,REQUEST,name):
   pass
________________________________________
= Reject - Entry #3 by tseaver on Mar 1, 2005 11:33 am

 Status: Pending => Rejected

The __bobo_traverse__ in your example is buggy:

   def __bobo_traverse__(self,REQUEST,name=None):
      if hasattr(self,name):
         return getattr(self,name)
      return self.get(name, None)

The object derives from OFS.Folder.Folder, which has no 'get' method:

  zopectl> debug
  Starting debugger (the name "app" is bound to the top-level Zope object)
  >>> from OFS.Folder import Folder
  >>> f = Folder()
  >>> f.get
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  AttributeError: get


________________________________________
= Comment - Entry #2 by llonchj on Feb 28, 2005 7:07 pm

Attached you will find a file called "MyTest.tgz" that corresponds to a minimalistic product to reproduce a bug.

________________________________________
= Request - Entry #1 by llonchj on Feb 28, 2005 7:06 pm


Uploaded:  "MyTest.tgz"
 - http://www.zope.org/Collectors/Zope/1716/MyTest.tgz/view
I don't know too much Zope to determine the nature of this error.

<b>It's not possible to add new files using ftp and webdav when a __bobo_traverse__ function
is present in the object.</b>

Attached you will find a file called MyTest.py that corresponds to a minimalistic product to reproduce a bug.

Simply follow the next instructions

0) Install this product, 
1) Restart your Zope
2) Take a look at the MyTestProduct.py lines[21:26]
3) Set the MyTestProduct as auto-refresh mode in Control Panel
4) upload a file using FTP or WebDAV
5) Comment(#) __bobo_traverse__ function in file MyTestProduct.py lines[21:26]
6) upload a file using FTP or WebDAV and OOPS!!!
7) Undo comments(#) in __bobo_traverse__ function in file MyTestProduct.py lines[21:26]
8) Goto 4 ;)

Thanks,
==============================================================



More information about the Zope-Collector-Monitor mailing list