[Zope-CMF] [skins' Filesystem Directory View] Pb when migrating from Linux to Windows

Big Sebastien.Bigaret@inqual.com
05 Oct 2001 15:12:55 +0200


        Hi,

  I found out that there is a problem with skins' Filesystem Directory Views
when copying a Zope install. from linux to windows or vice-versa.
  As stated in some previous messages I found out in the archives this is
because the path separator should be '/' for linux and '\' for windows.

  There is a small patch you'll find at the end of this message trying to
solve the issue. As far as I tested (linux vs. windows 2000) this works fine
but maybe there are some particular side-effects I've missed. So if you have
any comment on this, I'd like to hear them!

  (BTW this is the reason why I did not submit this in the Tracker since I'm
   not sure about possible side-effects and unfortunately not have much time
   to investigate any further).

  Oooh, last remark: using normcase() does *not* solve the problem ; I just
don't know whether this is a specific windows 2000 problem (which /seems/ to be
case-insensitive when it comes to path resolution) or... whatever it could be,
including my own misunderstanding ;) [again, I do not have time to really
search, and the windows machine I have at hand is real slow]

  Hope this might help,

        Kind regards,

-- SB aka Big

Index: DirectoryView.py
===================================================================
RCS file: /cvs-repository/CMF/CMFCore/DirectoryView.py,v
retrieving revision 1.11
diff -u -r1.11 DirectoryView.py
--- DirectoryView.py    20 Sep 2001 18:07:40 -0000      1.11
+++ DirectoryView.py    5 Oct 2001 12:56:39 -0000
@@ -381,6 +381,8 @@
     security = ClassSecurityInfo()
 
     def __init__(self, real, data, objects):
+        if real._dirpath!=path.normpath(real._dirpath):
+            real._dirpath=path.normpath(real._dirpath)
         d = self.__dict__
         d.update(data)
         d.update(real.__dict__)