[Zope-CMF] RE: ZEO-strangeness.

Tom Bech tom.bech@adcore.no
Tue, 24 Jul 2001 17:53:34 +0200


> 
> Hi!
> 
> I believe I've found the problem:
> 
> In CMFCore/DirectoryView.py, in the __of__ method in the DiretoryView
> class, the call to _dirreg.getDirectory() fails, so the 
> content of the view
> is never delivered and results in an "empty" skins folder. The reason
> is that on win32 the path to the skins is on the 
> \CMFDefault\skins\blah
> variant while on unix it is /CMFDefault/skins/blah. So, 
> depending on which
> of the clients imported CMF first, it ends up as one or the other in
> the database. Now, DirectoryView tries to do the right thing 
> via os.path
> stuff, but it uses the stored path-name directly as a lookup into the
> _directories
> dictionary in the DirectoryRegistry class (in getDirectoryInfo()),
> which then will miss on one of the two clients. Doing a 
> path.normpath() on
> the
> input path fixes the problem (or at least the symptoms :)
> 
> Patch (against CMF1.1) attached.
> 

(I know it's a bad habit replying to myself :)

*Argh* it turns out normpath() only converts forward slashes to backwards
on windows, and of course not vice-versa on unix - so it will still fail if
CMF was first imported on a windows-client.. :(

So, here's a new patch. It's still "hackish"; it will still
fail on Macs, for instance. The best solution would probably be
to not use paths directly as lookups at all..

Tom