[Zope3-dev] Re: SVN: Zope3/trunk/src/zope/app/dav/propfind.py
Removed DWIM callable check. (It happened to do the Wrong Thing for
Philipp von Weitershausen
philipp at weitershausen.de
Fri Jul 16 12:57:48 EDT 2004
Jim Fulton wrote:
> Log message for revision 26364:
> Removed DWIM callable check. (It happened to do the Wrong Thing for
> proxied data.)
>
>
>
> -=-
> Modified: Zope3/trunk/src/zope/app/dav/propfind.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/dav/propfind.py 2004-07-09 19:28:16 UTC (rev 26363)
> +++ Zope3/trunk/src/zope/app/dav/propfind.py 2004-07-09 19:36:39 UTC (rev 26364)
> @@ -115,12 +115,8 @@
> adapter = iface(self.context, None)
> initial = {}
> for name in avail.get(ns):
> - attr = getattr(adapter, name, None)
> - if attr is not None:
> - if callable(attr):
> - value = attr()
> - else:
> - value = attr
> + value = getattr(adapter, name, None)
> + if value is not None:
> initial[name] = value
> setUpWidgets(self, iface, IDAVWidget,
> ignoreStickyValues=True, initial=initial,
Jim,
this evidently breaks DAV support in Zope3. This is what I did:
- start out with an empty ZODB and start Zope
- open cadaver to http://localhost:8080
- cadaver says:
Could not access / (not WebDAV-enabled?):
207 Multi-Status
Connection to `localhost' closed.
- Using tcpwatch, I find out that the response body of the request contains:
<?xml version="1.0" ?>
<multistatus
xmlns="DAV:"><response><href>http://localhost:9080/</href><propstat><prop><getcontentlength><bound
method DAVSchemaAdapter.getcontentlength of
<zope.app.dav.adapter.DAVSchemaAdapter object at
0x176ab30>></getcontentlength><getlastmodified><bound method
DAVSchemaAdapter.getlastmodified of
<zope.app.dav.adapter.DAVSchemaAdapter object at
0x176ab30>></getlastmodified><displayname><bound method
DAVSchemaAdapter.displayname of
<zope.app.dav.adapter.DAVSchemaAdapter object at
0x176ab30>></displayname><resourcetype><bound method
DAVSchemaAdapter.resourcetype of
<zope.app.dav.adapter.DAVSchemaAdapter object at
0x176ab30>></resourcetype></prop><status>HTTP/1.1 200
OK</status></propstat><propstat><prop
xmlns:a0="http://apache.org/dav/props/"><executable
xmlns="a0"/></prop><status>HTTP/1.1 404 Not
Found</status></propstat></response></multistatus>
Now, you see that instead of having these methods called, you see the
repr() of them as objects. Reverting the change like using
svn merge -r 26364:26363 ...
makes WebDAV work again. Since I don't know what exactly that "Wrong
Thing" was that the code you removed was doing, I can't provide a fix
just now.
Philipp
P.S.: Interesting enough, the functional tests pass. Then again, this is
not the first time that I find out DAV needs more attention and more
tests...
More information about the Zope3-dev
mailing list