[Checkins] SVN: Zope3/branches/3.2/ - Fixed bug #728: Able to change-dir into non-existant directories using FTP

Christian Theune ct at gocept.com
Mon Dec 18 04:20:37 EST 2006


Log message for revision 71584:
  - Fixed bug #728:  Able to change-dir into non-existant directories using FTP
  

Changed:
  U   Zope3/branches/3.2/doc/CHANGES.txt
  U   Zope3/branches/3.2/src/zope/app/folder/filerepresentation.py
  U   Zope3/branches/3.2/src/zope/app/folder/tests.py

-=-
Modified: Zope3/branches/3.2/doc/CHANGES.txt
===================================================================
--- Zope3/branches/3.2/doc/CHANGES.txt	2006-12-18 09:14:12 UTC (rev 71583)
+++ Zope3/branches/3.2/doc/CHANGES.txt	2006-12-18 09:20:36 UTC (rev 71584)
@@ -10,6 +10,9 @@
 
     Bug fixes
 
+      - Fixed bug #728:  Able to change-dir into non-existant directories
+        using FTP
+
       - Fixed bug #717: formlib raised FormError when schema fields were
         missing from a request although not required.
 

Modified: Zope3/branches/3.2/src/zope/app/folder/filerepresentation.py
===================================================================
--- Zope3/branches/3.2/src/zope/app/folder/filerepresentation.py	2006-12-18 09:14:12 UTC (rev 71583)
+++ Zope3/branches/3.2/src/zope/app/folder/filerepresentation.py	2006-12-18 09:20:36 UTC (rev 71584)
@@ -19,7 +19,9 @@
 
 from zope.app.component.interfaces import ISite
 
+MARKER = object()
 
+
 class RootDirectoryFactory(object):
 
     def __init__(self, context):
@@ -30,8 +32,7 @@
 
 
 class ReadDirectory(object):
-    """Adapter to provide a file-system rendition of folders
-    """
+    """Adapter to provide a file-system rendition of folders."""
 
     def __init__(self, context):
         self.context = context
@@ -45,15 +46,14 @@
     def get(self, key, default=None):
         if key == '++etc++site' and ISite.providedBy(self.context):
             return self.context.getSiteManager()
-
         return self.context.get(key, default)
 
     def __iter__(self):
         return iter(self.keys())
 
     def __getitem__(self, key):
-        v = self.get(key, self)
-        if v is self:
+        v = self.get(key, MARKER)
+        if v is MARKER:
             raise KeyError(key)
         return v
 

Modified: Zope3/branches/3.2/src/zope/app/folder/tests.py
===================================================================
--- Zope3/branches/3.2/src/zope/app/folder/tests.py	2006-12-18 09:14:12 UTC (rev 71583)
+++ Zope3/branches/3.2/src/zope/app/folder/tests.py	2006-12-18 09:20:36 UTC (rev 71584)
@@ -19,8 +19,10 @@
 from unittest import TestCase, TestSuite, main, makeSuite
 
 from zope.testing.doctestunit import DocTestSuite
+from zope.testing import doctest
 
 from zope.app.testing import ztapi
+from zope.app.testing.functional import FunctionalDocFileSuite
 from zope.app.dublincore.interfaces import IZopeDublinCore
 from zope.app.folder.interfaces import IFolder
 from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
@@ -59,9 +61,11 @@
     return TestSuite((
         makeSuite(Test),
         makeSuite(FolderMetaDataTest),
+        FunctionalDocFileSuite("filerepresentation.txt",
+                               optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE),
         DocTestSuite('zope.app.folder.folder',
                      setUp=setUp, tearDown=tearDown),
-        ))    
+        ))
 
 if __name__=='__main__':
     main(defaultTest='test_suite')



More information about the Checkins mailing list