[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Launchpad #373299: Removed bogus string exception in OFS.CopySupport.

Tres Seaver tseaver at palladion.com
Thu May 7 12:30:47 EDT 2009


Log message for revision 99800:
  Launchpad #373299: Removed bogus string exception in OFS.CopySupport.
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testCopySupport.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2009-05-07 16:21:40 UTC (rev 99799)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2009-05-07 16:30:47 UTC (rev 99800)
@@ -8,6 +8,8 @@
 
     Bugs fixed
 
+      - Launchpad #373299: Removed bogus string exception in OFS.CopySupport.
+
   Zope 2.8.10 (2008/10/24)
 
     Bugs fixed

Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py	2009-05-07 16:21:40 UTC (rev 99799)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/CopySupport.py	2009-05-07 16:30:47 UTC (rev 99800)
@@ -32,7 +32,8 @@
 from webdav.Lockable import ResourceLockedError
 
 
-CopyError='Copy Error'
+class CopyError(Exception):
+    pass
 
 copy_re = re.compile('^copy([0-9]*)_of_(.*)')
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testCopySupport.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testCopySupport.py	2009-05-07 16:21:40 UTC (rev 99799)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/tests/testCopySupport.py	2009-05-07 16:30:47 UTC (rev 99800)
@@ -333,7 +333,7 @@
             if ce_regex is not None:
 
                 pattern = re.compile( ce_regex, re.DOTALL )
-                if pattern.search( e ) is None:
+                if pattern.search(str(e)) is None:
                     self.fail( "Paste failed; didn't match pattern:\n%s" % e )
 
             else:
@@ -404,8 +404,6 @@
 
     def test_copy_cant_create_target_metatype_not_supported( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = ()
 
@@ -435,8 +433,6 @@
 
     def test_move_cant_read_source( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = FILE_META_TYPES
 
@@ -455,8 +451,6 @@
 
     def test_move_cant_create_target_metatype_not_supported( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = ()
 
@@ -470,8 +464,6 @@
 
     def test_move_cant_create_target_metatype_not_allowed( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = FILE_META_TYPES
 
@@ -489,7 +481,6 @@
 
     def test_move_cant_delete_source( self ):
 
-        from OFS.CopySupport import CopyError
         from AccessControl.Permissions import delete_objects as DeleteObjects
 
         folder1, folder2 = self._initFolders()



More information about the Zope-Checkins mailing list